From 23d325cc76c8c77b54b2fadfd86aa48f6ee599f3 Mon Sep 17 00:00:00 2001 From: HuabingZhao Date: Sat, 19 Aug 2017 04:33:16 +0000 Subject: Dockerfile and building scripts for discovery Issue-Id: MSB-19 Change-Id: I907b96de27838ea55f61f1ad340d2ceaf3238c9c Signed-off-by: HuabingZhao --- build4docker.sh | 46 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) (limited to 'build4docker.sh') diff --git a/build4docker.sh b/build4docker.sh index 33910d8..8ecd60c 100644 --- a/build4docker.sh +++ b/build4docker.sh @@ -20,48 +20,15 @@ DIRNAME=`dirname $0` RUNHOME=`cd $DIRNAME/; pwd` echo @RUNHOME@ $RUNHOME -echo @JAVA_HOME@ $JAVA_HOME - -#build -mvn clean install - - - -#cooy +#copy RELEASE_BASE_DIR=$RUNHOME/release -CONSUL_RELEASE_DIR=${RELEASE_BASE_DIR}/msb-consul - -rm -rf $CONSUL_RELEASE_DIR -mkdir $CONSUL_RELEASE_DIR -p - -DOCKER_RUN_NAME=msb_consul -DOCKER_IMAGE_NAME=msb_consul -DOCKER_RELEASE_VERSION=0.7.5 - -cp -r $RUNHOME/consul/target/version/* ${CONSUL_RELEASE_DIR} -cp $RUNHOME/ci/build_docker_image.sh ${CONSUL_RELEASE_DIR} -#build docker image -cd ${CONSUL_RELEASE_DIR} -chmod 777 build_docker_image.sh - -#clear old version -docker rm -f ${DOCKER_RUN_NAME} -docker rmi ${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION} - - -./build_docker_image.sh -n=${DOCKER_IMAGE_NAME} -v=${DOCKER_RELEASE_VERSION} -d=./docker - -#docker run -docker run -d --net=host --name ${DOCKER_RUN_NAME} ${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION} -docker ps |grep ${DOCKER_RUN_NAME} - - RELEASE_DIR=${RELEASE_BASE_DIR}/msb-discovery DOCKER_RUN_NAME=msb_discovery DOCKER_IMAGE_NAME=msb_discovery DOCKER_RELEASE_VERSION=latest +DOCKER_REPOSITORY=nexus3.onap.org:10003 rm -rf $RELEASE_DIR mkdir $RELEASE_DIR -p @@ -74,12 +41,15 @@ cd ${RELEASE_DIR} chmod 777 build_docker_image.sh docker rm -f ${DOCKER_RUN_NAME} -docker rmi ${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION} +docker rmi ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION} -./build_docker_image.sh -n=${DOCKER_IMAGE_NAME} -v=${DOCKER_RELEASE_VERSION} -d=./docker +./build_docker_image.sh -n=${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME} -v=${DOCKER_RELEASE_VERSION} -d=./docker #docker run -docker run -d --net=host --name ${DOCKER_RUN_NAME} ${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_VERSION} +docker run -d --net=host --name ${DOCKER_RUN_NAME} ${DOCKER_REPOSITORY}/onap/msb/${DOCKER_IMAGE_NAME}:${DOCKER_RELEASE_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} -- cgit 1.2.3-korg