10 echo "last log lines are"
12 echo "see file $LOG for details"
18 git checkout master 2>>$LOG 1>>$LOG
19 if [ -f stashed ]; then
20 git stash pop 2>>$LOG 1>>$LOG
25 # Check if there are pending changes
26 status=`git status --porcelain|grep -v "??"`
29 echo "The following files are not committed:"
34 git stash save 2>&1 >>$LOG
38 # Get version or tag to checkout from cmd-line
41 echo -n "checking commit $1... "
42 out=`git show $1 2>&1|grep "fatal: ambiguous argument '$1'"`
48 fail "retrieving info about commit $1"
51 echo -n "checking out latest tag ("
52 tag=`git tag |tail -n 1`
56 # Tags are marked as aquarium-*
57 if [[ "$tag" =~ "aquarium-" ]];
71 echo "Checking out $tag"
72 git checkout $tag 2>>$LOG 1>>$LOG || fail "checking out"
75 mvn clean install -DskipTests=true >>build.log || fail "building project"
77 echo "Collecting dependencies"
78 mvn dependency:copy-dependencies >> build.log || fail "collecting dependencies"
79 cp target/dependency/*.jar $DIR/lib || fail "copying dependencies"
81 echo "Copying Aquarium classes"
82 aquariumjar=`find target -type f|egrep "aquarium-[0-9\.]+(-SNAPSHOT)?\.jar"`
83 cp $aquariumjar $DIR/lib || fail "copying $aquariumjar"
85 echo "Copying scripts and config files"
86 cp dist/aquarium.sh $DIR/bin || fail "copying aquarium.sh"
87 cp dist/log4j.properties $DIR/conf|| fail "copying log4j.properties"
88 cp dist/aquarium.properties $DIR/conf || fail "copying aquarium.properties"
89 cp dist/policy.yaml $DIR/conf || fail "copying policy.yaml"
91 echo "Creating archive"
92 tar zcvf $DIR.tar.gz $DIR >> build.log 2>&1 || fail "creating archive"
99 echo "File $tag.tar.gz created succesfully"
101 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :