3 # Make an Aquarium binary distribution out of current working directory.
4 # Use at your own risk (i.e. make sure it compiles etc).
7 SHAFULL=`git rev-parse HEAD`
8 SHA=`echo $SHAFULL | cut -c 1-11`
9 DATE_FORMAT=+'%Y%m%d%H%M%S'
10 NOW=`date $DATE_FORMAT`
12 SERVER_SCRIPTS_SRC=$WHERE/scripts
13 CONF_SRC=$WHERE/src/main/resources
17 echo "failed while $1"
23 echo Folder $DIST exists. Removing it.
27 echo Creating dist dirs
40 echo "==============================="
41 echo "=== mvn clean ================="
42 echo "==============================="
44 mvn clean || fail "cleaning compilation artifacts"
46 elif [ "$p"="dev" -o "$p"="fast" -o "$p"="noclean" ]; then
48 echo "==============================="
49 echo "=== NOT executing mvn clean ==="
50 echo "==============================="
56 mvn dependency:copy-dependencies && cp target/dependency/*.jar $DIST/lib || fail "collecting dependencies"
61 echo "==============================="
62 echo "=== mvn package ==============="
63 echo "==============================="
65 mvn package -DskipTests && {
66 echo "Copying Aquarium classes"
67 aquariumjar=`find target -type f|egrep "aquarium-[0-9\.]+(-SNAPSHOT)?\.jar"`
68 cp $aquariumjar $DIST/lib || fail "copying $aquariumjar"
74 echo Copying config files from $CONF_SRC
76 cp $CONF_SRC/log4j.properties $DIST/conf|| fail "copying log4j.properties"
77 cp $CONF_SRC/aquarium.properties $DIST/conf || fail "copying aquarium.properties"
78 cp $CONF_SRC/policy.yaml $DIST/conf || fail "copying policy.yaml"
79 cp $CONF_SRC/roles-agreements.map $DIST/conf || fail "copying roles-agreements.map"
84 echo Copying scripts from $SERVER_SCRIPTS_SRC
86 cp $SERVER_SCRIPTS_SRC/aquarium.sh $DIST/bin || fail "copying aquarium.sh"
87 cp $SERVER_SCRIPTS_SRC/test.sh $DIST/bin || fail "copying test.sh"
91 echo $SHAFULL > $DIST/gitsha.txt
96 echo "Creating archive"
97 tar zcvf $ARC $DIST/ || fail "creating archive"
98 echo "File $ARC created succesfully"