diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2017-10-16 18:56:02 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2017-10-16 18:56:02 +0800 |
commit | fafacadd60b9b3066f014c979bc531d00325a692 (patch) | |
tree | 8dfcf842821ac21e8f656c8cd28a7b77a5af625c /wfenginemgrservice/src/main/docker | |
parent | 614d7112b9a1420e3539503564bbb3fb35bd397a (diff) |
Add vfc docker build staging tag
Change-Id: I75892407cfc5200bf96803d7541565baff226fce
Issue-Id: VFC-535
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'wfenginemgrservice/src/main/docker')
-rw-r--r-- | wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh b/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh index 3cb0918..b4cdc47 100644 --- a/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh +++ b/wfenginemgrservice/src/main/docker/wfenginemgrservice-docker-build_image.sh @@ -8,11 +8,13 @@ cd ${DOCKER_BUILD_DIR} BUILD_ARGS="--no-cache" ORG="onap" # VERSION="1.0.0" -VERSION="1.0.0-SNAPSHOT" +DOCKER_VER="1.0.0" +VERSION="${DOCKER_VER}-SNAPSHOT" PROJECT="vfc" IMAGE="wfengine-mgrservice" DOCKER_REPOSITORY="nexus3.onap.org:10003" IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}" +TIMESTAMP=$(date +"%Y%m%dT%H%M%S") if [ -z $NEXUS_REPOS_URL ]; then NEXUS_REPOS_URL="https://nexus.onap.org" @@ -79,13 +81,23 @@ mv workflow-engine-mgr-service*.jar ./bin/workflow-engine-mgr-service.jar function build_image { echo "Start build docker image: ${IMAGE_NAME}" - docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest . + docker build ${BUILD_ARGS} -t ${IMAGE_NAME}:latest . +} + +function push_image_tag { + TAG_NAME=$1 + echo "Start push ${TAG_NAME}" + docker tag ${IMAGE_NAME}:latest ${TAG_NAME} + docker push ${TAG_NAME} } function push_image { - echo "Start push docker image: ${IMAGE_NAME}" - docker push ${IMAGE_NAME}:${VERSION} + echo "Start push ${IMAGE_NAME}:latest" docker push ${IMAGE_NAME}:latest + + push_image_tag ${IMAGE_NAME}:${DOCKER_VER}-SNAPSHOT-latest + push_image_tag ${IMAGE_NAME}:${DOCKER_VER}-STAGING-latest + push_image_tag ${IMAGE_NAME}:${DOCKER_VER}-STAGING-${TIMESTAMP} } build_image |