aboutsummaryrefslogtreecommitdiffstats
path: root/docker-build.sh
diff options
context:
space:
mode:
authorLusheng <lji@research.att.com>2017-03-09 04:57:19 +0000
committerLusheng <lji@research.att.com>2017-03-09 04:57:19 +0000
commitde400eb69786c8d4deb41085805c80ad41406eb3 (patch)
tree5ee17c71aeb7484fd9f2bc1ccebeff7729906eda /docker-build.sh
parentaeffd84bf430e6cb14e617e958c99a42fbfea2c6 (diff)
docker versioning
Change-Id: I99ae9992328b1ce889dc1e5bac58f15d010606e4 Signed-off-by: Lusheng <lji@research.att.com>
Diffstat (limited to 'docker-build.sh')
-rwxr-xr-xdocker-build.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/docker-build.sh b/docker-build.sh
index c0e60a8..d74b4dc 100755
--- a/docker-build.sh
+++ b/docker-build.sh
@@ -108,8 +108,15 @@ EOF
#
# build the docker image. tag and then push to the remote repo
#
-IMAGE='dcae-controller-common-event'
-TAG='1.0.0'
+IMAGE='openecomp/dcae-controller-common-event'
+#TAG='1.0.0'
+VERSION=$(xpath -e "//project/version/text()" "pom.xml")
+EXT=$(echo "$VERSION" | rev | cut -s -f1 -d'-' | rev)
+if [ -z "$EXT" ]; then
+ VERSION=$(echo "${VERSION}-STAGING")
+fi
+TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
+TAG="$VERSION-$TIMESTAMP"
LFQI="${IMAGE}:${TAG}"
BUILD_PATH="${WORKSPACE}/target/stage"
@@ -138,4 +145,13 @@ if [ ! -z "$REPO" ]; then
# push to remote repo
docker push "${RFQI}"
+
+
+ TAG="LATEST"
+ LFQI="${IMAGE}:${TAG}"
+ RFQI2="${REPO}/${LFQI}"
+ echo "$LFQI"
+ echo "$RFQI2"
+ docker tag "${RFQI}" "${RFQI2}"
+ docker push "${RFQI2}"
fi