diff options
Diffstat (limited to 'activiti-extension/src/main/docker')
-rw-r--r-- | activiti-extension/src/main/docker/activiti-docker-build_image.sh | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/activiti-extension/src/main/docker/activiti-docker-build_image.sh b/activiti-extension/src/main/docker/activiti-docker-build_image.sh index 51c523c..b6aefec 100644 --- a/activiti-extension/src/main/docker/activiti-docker-build_image.sh +++ b/activiti-extension/src/main/docker/activiti-docker-build_image.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env /bin/bash DIRNAME=`dirname $0` DOCKER_BUILD_DIR=`cd $DIRNAME/; pwd` @@ -16,8 +16,28 @@ IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}" POM_DIR="../../../" cd ${POM_DIR} -VERSION=$(printf 'VER\t${project.version}'|mvn help:evaluate|grep '^VER'|cut -f2|echo) -#VERSION=$(printf 'VER\t${project.version}'|mvn help:evaluate) + +mvncmd=$(whereis mvn | grep ^mvn |awk '{print $2}') +echo mvncmd=$mvncmd +if [[ 1$mvncmd != 1 ]]; then + echo $mvncmd +elif [ $MVN ]; then + mvncmd=$MVN +elif [ $M2_HOME ]; then + mvncmd=$M2_HOME/bin/mvn +elif [ -f "/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn" ]; then + mvncmd="/w/tools/hudson.tasks.Maven_MavenInstallation/mvn33/bin/mvn" +elif [ -f "/usr/share/maven/bin/mvn" ]; then + mvncmd="/usr/share/maven/bin/mvn" +else + echo "Maven is not installed, mvncmd=$mvncmd" + exit 1 +fi + +pwd +#VERSION=$(printf 'VER\t${project.version}\n0'|$mvncmd help:evaluate) +#echo "0VERSION=${VERSION}" +VERSION=$(printf 'VER\t${project.version}'|$mvncmd help:evaluate|grep '^VER'|cut -f2) echo "VERSION=${VERSION}" cd ${DOCKER_BUILD_DIR} @@ -80,7 +100,18 @@ mkdir -p ./temp/WEB-INF/lib/ cp -f activiti-extension*.jar ./temp/WEB-INF/lib/activiti-extension.jar echo "update activiti-rest.war" -$JAVA_HOME/bin/jar -uvf activiti-rest.war -C ./temp/ ./ +jarcmd=$(whereis jar | grep ^jar |awk '{print $2}') +if [ 1$jarcmd != 1 ]; then + echo $jarcmd +elif [ $JAVA_HOME ]; then + jarcmd=$JAVA_HOME/bin/jar +elif [ -f "/usr/lib/jvm/java-8-openjdk-amd64/bin/jar" ]; then + jarcmd="/usr/lib/jvm/java-8-openjdk-amd64/bin/jar" +else + exit 1 +fi +echo "jarcmd=${jarcmd}" +$jarcmd -uvf activiti-rest.war -C ./temp/ ./ #. >/dev/null 2>&1 -C ./temp cp activiti-rest.war ./build/apache-tomcat/webapps/ cp -Rf bin/* ./build/apache-tomcat/bin |