aboutsummaryrefslogtreecommitdiffstats
path: root/build4docker.sh
diff options
context:
space:
mode:
authorHuabingZhao <zhao.huabing@zte.com.cn>2017-08-19 04:33:16 +0000
committerHuabingZhao <zhao.huabing@zte.com.cn>2017-08-19 04:33:27 +0000
commit23d325cc76c8c77b54b2fadfd86aa48f6ee599f3 (patch)
tree9a444b1b9032a6320892097e455c8fba067a5912 /build4docker.sh
parented667f8483e066e6c518a12caafdaca4e352e9fa (diff)
Dockerfile and building scripts for discovery
Issue-Id: MSB-19 Change-Id: I907b96de27838ea55f61f1ad340d2ceaf3238c9c Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'build4docker.sh')
-rw-r--r--build4docker.sh46
1 files changed, 8 insertions, 38 deletions
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}