-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathversion
executable file
·33 lines (27 loc) · 951 Bytes
/
version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Builds a stable version of Caterwaul.
if [[ $# == 0 ]]; then
# Gnarly sed expression used to put versions in roughly the right order. Changes are reverted before
# printing them.
ls stable/*.tar.bz2 |
sed -r 's/^[^0-9]*([0-9]+\.[0-9]+(\.[0-9]+)?([rb][0-9]+)?)\.tar.*$/\1.01/; s/b/.00/g; s/r/.99/g' |
sort -n | sed 's/\.01$//; s/\.00/b/g; s/\.99/r/g'
exit 0
fi
if [[ -d stable/$1 ]]; then
echo version $1 already exists
exit 1
fi
./caterwaul render || exit 1
mkdir -p stable/$1
cp -r build/* src caterwaul waul* stable/$1/
cp waul bin/waul-$1
cp waul-core bin/waul-core-$1
branchname=$(git status -sb | awk '{print $2}' | sed 's/\.\.\..*$//' | head -n1)
git add stable/$1
git commit -am "Automatic commit for version $1"
git tag version-$1
cp .git/refs/heads/$branchname stable/$1/commit-id
tar -cj stable/$1 > stable/$1.tar.bz2
git add stable/$1* bin
git commit -am "Automatic commit for version $1 deployment"