diff options
author | Arun Arora <aroraarun@vmware.com> | 2017-10-31 19:18:24 +0530 |
---|---|---|
committer | Arun Arora <aroraarun@vmware.com> | 2017-10-31 19:18:24 +0530 |
commit | b8c721dcadb78025368de9516f5f669c3c694a01 (patch) | |
tree | 4402884daa86ac38e419d313d1b10a39cf52e9fb /vesagent | |
parent | d84b547bf4aa3b12109677d7d0c5a7759ead80b5 (diff) |
VMWare VESAgent changes for Staging image
1. Added rules to create and push staging image
2. Modified JAR file name to remove SNAPSHOT
3. Modified start-manager.sh to use new JAR file name
4. Optimizations in docker build script
Change-Id: I154f8a6a5d2b42f914b09c8f7a09190596483fca
Issue-ID: MULTICLOUD-8
Signed-off-by: Arun Arora <aroraarun@vmware.com>
Diffstat (limited to 'vesagent')
-rw-r--r-- | vesagent/docker/Dockerfile | 2 | ||||
-rwxr-xr-x | vesagent/docker/docker-build.sh | 18 | ||||
-rwxr-xr-x | vesagent/docker/opt/start-manager.sh | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/vesagent/docker/Dockerfile b/vesagent/docker/Dockerfile index 732a263..290333b 100644 --- a/vesagent/docker/Dockerfile +++ b/vesagent/docker/Dockerfile @@ -21,7 +21,7 @@ ADD opt /opt #Download vesagent jar from nexus repo and place in /opt RUN cd /opt/ && \ - wget -O /opt/vesagent-1.0.0-SNAPSHOT.jar 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.multicloud.openstack.vmware&a=vesagent&v=LATEST&e=jar' + wget -O /opt/vesagent-1.0.0.jar 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.multicloud.openstack.vmware&a=vesagent&v=LATEST&e=jar' # Install any needed packages specified in requirements.txt RUN pip install -r requirements.txt diff --git a/vesagent/docker/docker-build.sh b/vesagent/docker/docker-build.sh index 256ec04..ac2ea33 100755 --- a/vesagent/docker/docker-build.sh +++ b/vesagent/docker/docker-build.sh @@ -1,6 +1,7 @@ #!/bin/bash echo "WORKSPACE: ${WORKSPACE}" VERSION="1.0.0-SNAPSHOT" +STAGING="1.0.0-STAGING" # # Copy configurations directory @@ -32,16 +33,14 @@ fi if [ -d "${PY_DIR}" ] then - echo "Remove all dummy & test scripts" - rm -f ${PY_DIR}/dummy* - rm -f ${PY_DIR}/test* -fi - -APP_DIR=${WORKSPACE}/vesagent/docker/opt + [ -d "${APP_DIR}/py" ] && rm -rf "${APP_DIR}/py" -[ -d "${APP_DIR}/py" ] && rm -rf "${APP_DIR}/py" + cp -a ${PY_DIR} ${APP_DIR} -cp -a ${PY_DIR} ${APP_DIR} + echo "Remove all dummy & test scripts" + rm -f ${APP_DIR}/py/dummy* + rm -f ${APP_DIR}/py/test* +fi # # build the docker image. tag and then push to the remote repo @@ -65,7 +64,7 @@ function build_image { # build the image echo "Start build docker image: ${IMAGE_NAME}" cd ${WORKSPACE}/vesagent/docker/ - docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest . + docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest -t ${IMAGE_NAME}:${STAGING} . } function push_image { @@ -73,6 +72,7 @@ function push_image { echo "Start push docker image: ${IMAGE_NAME}" docker push ${IMAGE_NAME}:${VERSION} docker push ${IMAGE_NAME}:latest + docker push ${IMAGE_NAME}:${STAGING} } build_image diff --git a/vesagent/docker/opt/start-manager.sh b/vesagent/docker/opt/start-manager.sh index 76adfe4..735f0d9 100755 --- a/vesagent/docker/opt/start-manager.sh +++ b/vesagent/docker/opt/start-manager.sh @@ -1,4 +1,4 @@ #!/bin/bash # TODO: Enable the below command to execute the VESAgent process -exec java -jar /opt/vesagent-1.0.0-SNAPSHOT.jar /opt/etc/Agent.properties +exec java -jar /opt/vesagent-1.0.0.jar /opt/etc/Agent.properties #while :; do echo 'sleeping for 3600 secs'; sleep 3600; done |