summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build4docker.sh32
1 files changed, 25 insertions, 7 deletions
diff --git a/build4docker.sh b/build4docker.sh
index c316146..f112b5d 100644
--- a/build4docker.sh
+++ b/build4docker.sh
@@ -27,13 +27,13 @@ RELEASE_BASE_DIR=$RUNHOME/release
RELEASE_DIR=${RELEASE_BASE_DIR}/registrator
DOCKER_RUN_NAME=kube2msb
DOCKER_IMAGE_NAME=kube2msb
-DOCKER_RELEASE_VERSION=latest
+DOCKER_LATEST_VERSION=latest
+DOCKER_RELEASE_VERSION=1.0.0
DOCKER_REPOSITORY=nexus3.onap.org:10003
rm -rf $RELEASE_DIR
mkdir $RELEASE_DIR -p
-
cp -r $RUNHOME/target/* ${RELEASE_DIR}
cp $RUNHOME/build/docker/* ${RELEASE_DIR}
#build docker image
@@ -41,15 +41,33 @@ cd ${RELEASE_DIR}
chmod 777 build_docker_image.sh
docker rm -f ${DOCKER_RUN_NAME}
-docker rmi ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}
+docker rmi ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION}
+docker rmi ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-latest
+docker rmi ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-latest
-./build_docker_image.sh -n=${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME} -v=${DOCKER_RELEASE_VERSION} -d=./docker
+./build_docker_image.sh -n=${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME} -v=${DOCKER_LATEST_VERSION} -d=./docker
#docker run
-docker run -d --net=host --name ${DOCKER_RUN_NAME} ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}
+docker run -d --net=host --name ${DOCKER_RUN_NAME} ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION}
docker ps |grep ${DOCKER_RUN_NAME}
-echo "Pushing ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}"
-docker push ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}
+echo "Pushing ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION}"
+docker push ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION}
+
+echo "Pushing ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-latest"
+docker tag ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION} ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-latest
+docker push ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-latest
+
+echo "Pushing ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-${TIMESTAMP}"
+docker tag ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION} ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-${TIMESTAMP}
+docker push ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-STAGING-${TIMESTAMP}
+
+echo "Pushing ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-latest"
+docker tag ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION} ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-latest
+docker push ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-latest
+
+echo "Pushing ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-${TIMESTAMP}"
+docker tag ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_LATEST_VERSION} ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-${TIMESTAMP}
+docker push ${DOCKER_REPOSITORY}/onap/oom/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION}-SNAPSHOT-${TIMESTAMP} \ No newline at end of file