#!/bin/bash
+# Builds and pushes STAGING versions of Portal images
-./run.sh
+# be verbose
+set -x
-REPO="nexus3.onap.org:10003"
+# Establish environment variables
+source $(dirname $0)/.env
-TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
-VERSION="1.1.0-STAGING-${TIMESTAMP}"
-LATEST="1.1-STAGING-latest"
-
-APPS_VERSION="${REPO}/openecomp/portalapps:${VERSION}"
-DB_VERSION="${REPO}/openecomp/portaldb:${VERSION}"
+if [ -z "$PORTAL_VERSION" ]; then
+ echo "PORTAL_VERSION not set"
+ exit 1
+fi
-APPS_LATEST="${REPO}/openecomp/portalapps:${LATEST}"
-DB_LATEST="${REPO}/openecomp/portaldb:${LATEST}"
-
-# tag version
-docker tag ep:1610-1 ${APPS_VERSION}
-docker tag ecompdb:portal ${DB_VERSION}
-docker tag ep:1610-1 ${APPS_LATEST}
-docker tag ecompdb:portal ${DB_LATEST}
+TIMESTAMP=$(date +%C%y%m%dT%H%M%S)
+export VERSION="${PORTAL_VERSION}-${TIMESTAMP}"
+export LATEST="${PORTAL_VERSION}"
-# push
-docker push ${APPS_VERSION}
-docker push ${DB_VERSION}
-docker push ${APPS_LATEST}
-docker push ${DB_LATEST}
+exec ./os_docker_base.sh