Elffuss BraidHub

kikocis/java-driver public

c3456ea3ec0f · 1.4 KiB · executableRawPermalink
1#!/bin/sh
2
3SCRIPT_DIR=$( cd "$( dirname "$0" )" && pwd )
4CURRENT_DIR=$( pwd )
5
6LOG_FILE="$CURRENT_DIR/stress_build.log"
7VERSION_FILE="$SCRIPT_DIR/../.stress.version"
8
9[ -f $LOG_FILE ] && rm $LOG_FILE
10[ -f $VERSION_FILE ] && rm $VERSION_FILE
11
12echo "Building java driver ..."
13echo "-- Driver build --\n" > $LOG_FILE
14
15cd $SCRIPT_DIR/../../..
16mvn clean install -Dmaven.test.skip=true >> $LOG_FILE 2>&1
17EXIT_CODE=$?
18if [ $EXIT_CODE -ne 0 ];
19then
20 echo "Error building driver. See $LOG_FILE for details." 1>&2
21 cd $CURRENT_DIR
22 exit $EXIT_CODE
23fi
24
25echo "Building stress application ..."
26echo "\n-- Stress build --\n" >> $LOG_FILE
27
28cd $SCRIPT_DIR/..
29mvn assembly:single >> $LOG_FILE 2>&1
30EXIT_CODE=$?
31if [ $EXIT_CODE -ne 0 ];
32then
33 echo "Error building stress application. See $LOG_FILE for details." 1>&2
34 cd $CURRENT_DIR
35 exit $EXIT_CODE
36fi
37
38# We don't want to hardcode the version in the stress launch file, but maven takes an unreasonabe time
39# just to return project version (even if the internet has already been downloaded). So for the common
40# case, just compute that version now and save it to some hidden file, so we speed up the execution script
41
42VERSION=`cd $SCRIPT_DIR/.. && mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|Download\w+:)'`
43echo "$VERSION" > $VERSION_FILE
44
45cd $CURRENT_DIR
46rm $LOG_FILE