4 DOCKER_BUILD_DIR=`cd $DIRNAME/; pwd`
5 echo "DOCKER_BUILD_DIR=${DOCKER_BUILD_DIR}"
8 BUILD_ARGS="--no-cache"
11 VERSION="1.0.0-SNAPSHOT"
13 IMAGE="wfengine-mgrservice"
14 DOCKER_REPOSITORY="nexus3.onap.org:10003"
15 IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}"
19 # VERSION=$(printf 'VER\t${project.version}'|mvn help:evaluate|grep '^VER'|cut -f2|echo)
20 # VERSION=$(printf 'VER\t${project.version}'|mvn help:evaluate)
21 echo "VERSION=${VERSION}"
23 cd ${DOCKER_BUILD_DIR}
24 if [[ $VERSION != *-SNAPSHOT ]]; then
25 NEXUSREPONAME="releases"
27 NEXUSREPONAME="snapshots"
29 echo "NEXUSREPONAME=${NEXUSREPONAME}"
31 if [ $HTTP_PROXY ]; then
32 BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
33 CURLPROXY="-x ${HTTP_PROXY}"
35 if [ $http_proxy ]; then
36 BUILD_ARGS+=" --build-arg HTTP_PROXY=${http_proxy}"
37 CURLPROXY="-x ${http_proxy}"
39 if [ $HTTPS_PROXY ]; then
40 BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
41 CURLPROXY="-x ${HTTS_PROXY}"
43 if [ $https_proxy ]; then
44 BUILD_ARGS+=" --build-arg HTTPS_PROXY=${https_proxy}"
45 CURLPROXY="-x ${https_proxy}"
47 echo "CURLPROXY=${CURLPROXY}"
49 rm -f ./bin/workflow-engine-mgr-service*.jar
50 echo "${CURLPROXY}" -m 300 -O -J -L "https://nexus.onap.org/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}" LATEST
51 curl "${CURLPROXY}" -m 300 -O -J -L "https://nexus.onap.org/service/local/artifact/maven/content?r=${NEXUSREPONAME}&g=org.onap.vfc.nfvo.wfengine&a=workflow-engine-mgr-service&e=jar&v=${VERSION}"
52 mv workflow-engine-mgr-service*.jar ./bin/workflow-engine-mgr-service.jar
54 function build_image {
55 echo "Start build docker image: ${IMAGE_NAME}"
56 docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest .
60 echo "Start push docker image: ${IMAGE_NAME}"
61 docker push ${IMAGE_NAME}:${VERSION}
62 docker push ${IMAGE_NAME}:latest