diff options
author | lj1412 <lji@research.att.com> | 2017-02-22 15:38:56 +0000 |
---|---|---|
committer | lj1412 <lji@research.att.com> | 2017-02-22 15:38:56 +0000 |
commit | c91f09fe9f004dd368bbb7d6d93deefb3557ec46 (patch) | |
tree | d062907c51520e8fbd2958e7f2682307b7a8d0b9 | |
parent | 7085ad1db14b3a8c0a2d3a3f8e5476fcdd189a60 (diff) |
docker build script
Change-Id: I1071f15a43e9ec41b24dc571444f49cf2910f8ee
Signed-off-by: lj1412 <lji@research.att.com>
-rwxr-xr-x | script-dmaapbc-docker-build.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/script-dmaapbc-docker-build.sh b/script-dmaapbc-docker-build.sh new file mode 100755 index 0000000..5727f55 --- /dev/null +++ b/script-dmaapbc-docker-build.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Create a debian package and push to remote repo +# +# +# build the docker image. tag and then push to the remote repo +# + +# !!! make sure the yaml file include docker-login as a builder before calling +# this script + +if [ "$#" != "1" ]; then + phase="verify" +else + phase="$1" + case $phase in + verify|merge|release) + echo "Running $phase job" + ;; + *) + echo "Unknown phase $phase" + exit 1 + esac +fi + + +IMAGE='dcae_dmaapbc' +TAG='1.0.0' +LFQI="${IMAGE}:${TAG}" +BUILD_PATH="${WORKSPACE}" + +# build a docker image +docker build --rm -f "${WORKSPACE}"/Dockerfile -t "${LFQI}" "${BUILD_PATH}" + +if [ "$phase" == "verify" ]; then + exit +fi + +# +# push the image +# +# io registry DOCKER_REPOSITORIES="nexus3.openecomp.org:10001 \ +# release registry nexus3.openecomp.org:10002 \ +# snapshot registry nexus3.openecomp.org:10003" +REPO='nexus3.openecomp.org:10003' +RFQI="${REPO}/${LFQI}" +docker tag ${LFQI} ${RFQI} +docker push ${RFQI} + |