aboutsummaryrefslogtreecommitdiffstats
path: root/build4docker.sh
diff options
context:
space:
mode:
authorHuabingZhao <zhao.huabing@zte.com.cn>2017-10-11 02:40:32 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-11 02:40:32 +0000
commit61b8ab243824d24d3f26f2fa4ac5abc8834471b8 (patch)
treefc0687d3843d6f92955d24c113ff9f222bb0ef38 /build4docker.sh
parentfd94734b952109e9080d45157b89555e16aab9d0 (diff)
parent339ba4ffb1f23a72190003bb76ab5757d6211fdd (diff)
Merge "Tag api gateway docker with stage and timestamp"
Diffstat (limited to 'build4docker.sh')
-rw-r--r--build4docker.sh35
1 files changed, 27 insertions, 8 deletions
diff --git a/build4docker.sh b/build4docker.sh
index 53012d4..c1813a4 100644
--- a/build4docker.sh
+++ b/build4docker.sh
@@ -35,8 +35,10 @@ mkdir $RELEASE_DIR -p
DOCKER_RUN_NAME=msb_apigateway
DOCKER_IMAGE_NAME=msb_apigateway
-DOCKER_RELEASE_VERSION=latest
+DOCKER_LATEST_VERSION=latest
+DOCKER_RELEASE_VERSION=1.0.0
DOCKER_REPOSITORY=nexus3.onap.org:10003
+TIMESTAMP=$(date +"%Y%m%dT%H%M%S")
cp -r $RUNHOME/distributions/msb-apigateway/target/version/* ${RELEASE_DIR}
cp $RUNHOME/ci/build_docker_image.sh ${RELEASE_DIR}
@@ -46,14 +48,31 @@ chmod 777 build_docker_image.sh
docker rm -f ${DOCKER_RUN_NAME}
-docker rmi ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}
+docker rmi ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION}
+docker rmi ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-latest
+docker rmi ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-latest
-./build_docker_image.sh -n=${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME} -v=${DOCKER_RELEASE_VERSION} -d=./docker
+./build_docker_image.sh -n=${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME} -v=${DOCKER_LATEST_VERSION} -d=./docker
-#docker run
-
-docker run -d --net=host --name ${DOCKER_RUN_NAME} ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}
+docker run -d --net=host --name ${DOCKER_RUN_NAME} ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION}
docker ps |grep ${DOCKER_RUN_NAME}
-echo "Pushing ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}"
-docker push ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION} \ No newline at end of file
+echo "Pushing ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION}"
+docker push ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION}
+
+echo "Pushing ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-latest"
+docker tag ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION} ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-latest
+docker push ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-latest
+
+echo "Pushing ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-${TIMESTAMP}"
+docker tag ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION} ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-${TIMESTAMP}
+docker push ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-${TIMESTAMP}
+
+echo "Pushing ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-latest"
+docker tag ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION} ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-latest
+docker push ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-latest
+
+echo "Pushing ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-${TIMESTAMP}"
+docker tag ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION} ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-${TIMESTAMP}
+docker push ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-${TIMESTAMP}
+