From c4731520f5c6e1251d42be50ed5b76faa7551e3c Mon Sep 17 00:00:00 2001
From: Eike Cochu <eike@cochu.com>
Date: Fri, 29 Jan 2016 16:47:21 +0100
Subject: [PATCH] updated build script

---
 build.sh | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/build.sh b/build.sh
index df5bbf20..304e42a6 100755
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,24 @@
 #!/bin/sh
 
+# =========================================================
+# CONFIGURATION
+# =========================================================
+
+# configuration for remote deploy, requirements:
+# * curl
+# * a recent tomcat server is required (8+)
+# * a user that is allowed to deploy, with following roles: tomcat, manager-gui, manager-script, manager-jmx, manager-status
+# * installed and running tomcat manager application
+DEPLOY="true"
+TOMCAT_HOST="localhost"
+TOMCAT_PORT="8000"
+TOMCAT_USER="tomcat"
+TOMCAT_PW="tomcat"
+
+# =========================================================
+# DO NOT EDIT AFTER THIS POINT
+# =========================================================
+
 LOG="build.log"
 rm -f $LOG
 
@@ -56,11 +75,13 @@ if [ $? -ne 0 ]; then
         exit 1
 fi
 
-echo "" >> $LOG
-echo "-------------------------------" >> $LOG
-echo "deploying vipra-rest" | tee -a $LOG
-echo "-------------------------------" >> $LOG
-curl 'http://tomcat:tomcat@localhost:8000/manager/text/deploy?path=/vipra-rest&update=true' --upload-file ./vipra-rest/target/vipra-rest.war >> $LOG 2>&1
+if [ $DEPLOY = "true" ]; then
+	echo "" >> $LOG
+	echo "-------------------------------" >> $LOG
+	echo "deploying vipra-rest" | tee -a $LOG
+	echo "-------------------------------" >> $LOG
+	curl "http://$TOMCAT_USER:TOMCAT_PW@$TOMCAT_HOST:$TOMCAT_PORT/manager/text/deploy?path=/vipra-rest&update=true" --upload-file ./vipra-rest/target/vipra-rest.war >> $LOG 2>&1
+fi
 
 echo "complete"
 exit $?
-- 
GitLab