summaryrefslogtreecommitdiffstats
path: root/build-dockers.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build-dockers.sh')
-rwxr-xr-xbuild-dockers.sh42
1 files changed, 35 insertions, 7 deletions
diff --git a/build-dockers.sh b/build-dockers.sh
index 6814e3e..b531542 100755
--- a/build-dockers.sh
+++ b/build-dockers.sh
@@ -1,8 +1,36 @@
#!/bin/bash
-# TODO (IKRAM): need to test api only first to test the docker upload chain.
-# Will enable the others once api is tested
-docker build -t api conductor/docker/api/
-docker build -t controller conductor/docker/controller/
-docker build -t data conductor/docker/data/
-docker build -t solver conductor/docker/solver/
-docker build -t reservation conductor/docker/reservation/
+BUILD_ARGS="--no-cache"
+ORG="onap"
+VERSION="1.1.1"
+STAGING="1.1.1-STAGING"
+PROJECT="optf-has"
+DOCKER_REPOSITORY="nexus3.onap.org:10003"
+IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}"
+TIMESTAMP=$(date +"%Y%m%dT%H%M%S")
+
+if [ $HTTP_PROXY ]; then
+BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
+fi
+if [ $HTTPS_PROXY ]; then
+ BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
+fi
+
+function build_image(){
+ echo Building Image
+ docker build -t ${IMAGE_NAME}:${VERSION} -t ${IMAGE_NAME}:latest -t ${IMAGE_NAME}:${STAGING} conductor/docker
+ echo ... Built
+}
+
+function push_image(){
+ echo Pushing image starts.
+ build_image
+
+ docker push ${IMAGE_NAME}:${VERSION}
+ docker push ${IMAGE_NAME}:latest
+ docker push ${IMAGE_NAME}:STAGING
+
+ echo ... Pushed $1
+}
+
+push_image
+