diff options
author | Zhaoxing <meng.zhaoxing1@zte.com.cn> | 2017-10-12 11:23:51 +0800 |
---|---|---|
committer | Zhaoxing <meng.zhaoxing1@zte.com.cn> | 2017-10-12 11:23:51 +0800 |
commit | 2f49c6932d9e2ce60531384a848546db7964833d (patch) | |
tree | 2a7c699ce6da0a952accb5e1b9ca950e8ed6de63 /wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh | |
parent | f55132f49d1dbe3bd24924a7edbcbd6ba6e16704 (diff) |
Modify artifact version for Workflow
Change-Id: Id8d4369d21159ec3351ee3d035d2a861c92bce66
Issue-Id: VFC-509
Signed-off-by: Zhaoxing <meng.zhaoxing1@zte.com.cn>
Diffstat (limited to 'wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh')
-rw-r--r-- | wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh b/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh index 52595da..224e62d 100644 --- a/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh +++ b/wfenginemgrservice/src/main/docker/wfenginemgrservice-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,26 @@ 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}'|$mvncmd help:evaluate|grep '^VER'|cut -f2)
echo "VERSION=${VERSION}"
cd ${DOCKER_BUILD_DIR}
|