From 54c20e1b6f133e11868ed4eecf2996d962c83bb1 Mon Sep 17 00:00:00 2001 From: "Axel Uhl (Server)" Date: Wed, 20 Feb 2013 00:39:47 +0100 Subject: [PATCH 1/2] Server directory no longer needed --- configuration/buildAndUpdateProduct.sh | 38 +++++++++++--------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/configuration/buildAndUpdateProduct.sh b/configuration/buildAndUpdateProduct.sh index c21f6a0cfce..6835dbc28bc 100755 --- a/configuration/buildAndUpdateProduct.sh +++ b/configuration/buildAndUpdateProduct.sh @@ -16,6 +16,7 @@ active_branch=$(git symbolic-ref -q HEAD) active_branch=`basename $active_branch` ACDIR=$SERVERS_HOME/$active_branch +MAVEN_SETTINGS=$PROJECT_HOME/configuration/maven-settings.xml gwtcompile=1 testing=1 @@ -55,11 +56,6 @@ do esac done -if [ ! -d $ACDIR ]; then - echo "Could not find directory $ACDIR - perhaps you are on a wrong branch?" - exit -fi - read -s -n1 -p "Currently branch $active_branch is active. Do you want to proceed (y/N): " answer case $answer in "Y" | "y") echo "Continuing";; @@ -70,30 +66,15 @@ esac shift $((OPTIND-1)) if [[ $@ == "" ]]; then - echo "You need to specify an action [build|install]" + echo "You need to specify an action [build|install|all]" exit 2 fi echo "Starting $@ of server..." -if [ ! -d "$ACDIR/plugins" ]; then - mkdir $ACDIR/plugins -fi - -if [ ! -d "$ACDIR/configuration" ]; then - mkdir $ACDIR/configuration -fi - -# make sure to have maven configuration here -cp -v $PROJECT_HOME/configuration/maven-settings.xml $ACDIR/ -MAVEN_SETTINGS=$ACDIR/maven-settings.xml - if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then # yield build so that we get updated product - # preserve old build log - cp $ACDIR/build.log $ACDIR/build.log.old - cd $PROJECT_HOME/java if [ $gwtcompile -eq 1 ]; then echo "INFO: Compiling GWT (rm -rf com.sap.sailing.gwt.ui/com.sap.sailing.*)" @@ -121,13 +102,26 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then fi echo "Using following command: mvn $extra -fae -s $MAVEN_SETTINGS $clean install" - mvn $extra -fae -s $MAVEN_SETTINGS $clean install 2>&1 | tee $ACDIR/build.log + mvn $extra -fae -s $MAVEN_SETTINGS $clean install 2>&1 | tee $PROJECT_HOME/build.log echo "Build complete. Do not forget to install product..." fi if [[ "$@" == "install" ]] || [[ "$@" == "all" ]]; then + if [ ! -d "$ACDIR/plugins" ]; then + mkdir $ACDIR/plugins + fi + + if [ ! -d "$ACDIR/configuration" ]; then + mkdir $ACDIR/configuration + fi + + if [ ! -d $ACDIR ]; then + echo "Could not find directory $ACDIR - perhaps you are on a wrong branch?" + exit + fi + cd $ACDIR rm -rf $ACDIR/plugins/*.* From dd8b47f3c8af365d8342c1d4b225abe79b1bd403 Mon Sep 17 00:00:00 2001 From: "Axel Uhl (Server)" Date: Wed, 20 Feb 2013 00:43:44 +0100 Subject: [PATCH 2/2] Directory for build.log defaults to pwd --- configuration/buildAndUpdateProduct.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configuration/buildAndUpdateProduct.sh b/configuration/buildAndUpdateProduct.sh index 6835dbc28bc..70ef74f557c 100755 --- a/configuration/buildAndUpdateProduct.sh +++ b/configuration/buildAndUpdateProduct.sh @@ -7,6 +7,7 @@ SERVERS_HOME=$USER_HOME/servers # x86 or x86_64 should work for most cases ARCH=x86_64 +START_DIR=`pwd` # needed for maven to work correctly source $USER_HOME/.bash_profile @@ -36,7 +37,7 @@ if [ $# -eq 0 ]; then echo "-c Disable cleaning (use only if you are sure that no java file has changed)" echo "-p Enable proxy mode" echo "" - echo "build: builds the server code using Maven to $PROJECT_HOME" + echo "build: builds the server code using Maven to $PROJECT_HOME (log to $START_DIR/build.log)" echo "install: installs product and configuration to $SERVERS_HOME/$active_branch. Overwrites any configuration by using config from branch." echo "all: calls build and then install" exit 2 @@ -102,7 +103,7 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then fi echo "Using following command: mvn $extra -fae -s $MAVEN_SETTINGS $clean install" - mvn $extra -fae -s $MAVEN_SETTINGS $clean install 2>&1 | tee $PROJECT_HOME/build.log + mvn $extra -fae -s $MAVEN_SETTINGS $clean install 2>&1 | tee $START_DIR/build.log echo "Build complete. Do not forget to install product..." fi