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-activiti"
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 echo "download Tomcat 8.5.20"
50 #curl "${CURLPROXY}" -m 300 -O -J -L "http://mirrors.shuosc.org/apache/tomcat/tomcat-8/v8.5.20/bin/apache-tomcat-8.5.20.tar.gz"
51 wget "http://mirrors.shuosc.org/apache/tomcat/tomcat-8/v8.5.20/bin/apache-tomcat-8.5.20.tar.gz"
52 tar -zxf apache-tomcat-8.5.20.tar.gz
53 mv apache-tomcat-8.5.20 apache-tomcat
55 echo "download Activiti 5.22.0"
56 wget "https://github.com/Activiti/Activiti/releases/download/activiti-5.22.0/activiti-5.22.0.zip"
57 #curl "${CURLPROXY}" -m 600 -O -J -L "https://github.com/Activiti/Activiti/releases/download/activiti-5.22.0/activiti-5.22.0.zip"
58 rm -Rf ./activiti-5.22.0/
59 sudo apt-get install p7zip-full
60 7za x activiti-5.22.0.zip
62 #unzip -o -q activiti-5.22.0.zip
63 #unzip -o -q activiti-5.22.0.zip "activiti-5.22.0/wars/activiti-rest.war" -d ./
64 mv activiti-5.22.0/wars/activiti-rest.war .
66 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=activiti-extension&e=jar&v=${VERSION}"
68 mkdir -p ./temp/WEB-INF/lib/
69 cp -f activiti-extension*.jar ./temp/WEB-INF/lib/activiti-extension.jar
71 $JAVA_HOME/bin/jar uvf activiti-rest.war -C ./temp .
72 cp activiti-rest.war ./apache-tomcat/webapps/
74 function build_image {
75 echo "Start build docker image: ${IMAGE_NAME}"
76 docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest .
80 echo "Start push docker image: ${IMAGE_NAME}"
81 docker push ${IMAGE_NAME}:${VERSION}
82 docker push ${IMAGE_NAME}:latest