mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-30 09:26:44 +00:00
Merge remote-tracking branch 'server/master'
This commit is contained in:
@@ -7,6 +7,7 @@ SERVERS_HOME=$USER_HOME/servers
|
|||||||
|
|
||||||
# x86 or x86_64 should work for most cases
|
# x86 or x86_64 should work for most cases
|
||||||
ARCH=x86_64
|
ARCH=x86_64
|
||||||
|
START_DIR=`pwd`
|
||||||
|
|
||||||
# needed for maven to work correctly
|
# needed for maven to work correctly
|
||||||
source $USER_HOME/.bash_profile
|
source $USER_HOME/.bash_profile
|
||||||
@@ -16,6 +17,7 @@ active_branch=$(git symbolic-ref -q HEAD)
|
|||||||
active_branch=`basename $active_branch`
|
active_branch=`basename $active_branch`
|
||||||
|
|
||||||
ACDIR=$SERVERS_HOME/$active_branch
|
ACDIR=$SERVERS_HOME/$active_branch
|
||||||
|
MAVEN_SETTINGS=$PROJECT_HOME/configuration/maven-settings.xml
|
||||||
|
|
||||||
gwtcompile=1
|
gwtcompile=1
|
||||||
testing=1
|
testing=1
|
||||||
@@ -35,7 +37,7 @@ if [ $# -eq 0 ]; then
|
|||||||
echo "-c Disable cleaning (use only if you are sure that no java file has changed)"
|
echo "-c Disable cleaning (use only if you are sure that no java file has changed)"
|
||||||
echo "-p Enable proxy mode"
|
echo "-p Enable proxy mode"
|
||||||
echo ""
|
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 "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"
|
echo "all: calls build and then install"
|
||||||
exit 2
|
exit 2
|
||||||
@@ -55,11 +57,6 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
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
|
read -s -n1 -p "Currently branch $active_branch is active. Do you want to proceed (y/N): " answer
|
||||||
case $answer in
|
case $answer in
|
||||||
"Y" | "y") echo "Continuing";;
|
"Y" | "y") echo "Continuing";;
|
||||||
@@ -70,30 +67,15 @@ esac
|
|||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
if [[ $@ == "" ]]; then
|
if [[ $@ == "" ]]; then
|
||||||
echo "You need to specify an action [build|install]"
|
echo "You need to specify an action [build|install|all]"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting $@ of server..."
|
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
|
if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
|
||||||
# yield build so that we get updated product
|
# yield build so that we get updated product
|
||||||
|
|
||||||
# preserve old build log
|
|
||||||
cp $ACDIR/build.log $ACDIR/build.log.old
|
|
||||||
|
|
||||||
cd $PROJECT_HOME/java
|
cd $PROJECT_HOME/java
|
||||||
if [ $gwtcompile -eq 1 ]; then
|
if [ $gwtcompile -eq 1 ]; then
|
||||||
echo "INFO: Compiling GWT (rm -rf com.sap.sailing.gwt.ui/com.sap.sailing.*)"
|
echo "INFO: Compiling GWT (rm -rf com.sap.sailing.gwt.ui/com.sap.sailing.*)"
|
||||||
@@ -121,13 +103,26 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Using following command: mvn $extra -fae -s $MAVEN_SETTINGS $clean install"
|
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 $START_DIR/build.log
|
||||||
|
|
||||||
echo "Build complete. Do not forget to install product..."
|
echo "Build complete. Do not forget to install product..."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$@" == "install" ]] || [[ "$@" == "all" ]]; then
|
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
|
cd $ACDIR
|
||||||
|
|
||||||
rm -rf $ACDIR/plugins/*.*
|
rm -rf $ACDIR/plugins/*.*
|
||||||
|
|||||||
Reference in New Issue
Block a user