3f110003d493511d2e218979fca0a0aa61be390d
[portal.git] / deliveries / os_docker_base.sh
1 #!/bin/bash
2 # Builds and pushes versions of Portal images
3 # Invoked by scripts that set VERSION and LATEST
4
5 # be verbose
6 set -x 
7
8 if [ -z "$VERSION" ]; then
9     echo "VERSION not set"
10     exit 1
11 fi
12 if [ -z "$LATEST" ]; then
13     echo "LATEST not set"
14     exit 1
15 fi
16
17 # ONAP docker registry for pushing; may need to move
18 # this into os_docker_push, os_docker_release scripts
19 NEXUS_REPO=nexus3.onap.org:10003
20
21 # Establish environment variables
22 source $(dirname $0)/.env
23
24 # Build the containers
25 ./build_portalapps_dockers.sh
26
27 APPS_VERSION="${NEXUS_REPO}/${EP_IMG_NAME}:${VERSION}"
28 DB_VERSION="${NEXUS_REPO}/${DB_IMG_NAME}:${VERSION}"
29 WMS_VERSION="${NEXUS_REPO}/${WMS_IMG_NAME}:${VERSION}"
30
31 APPS_LATEST="${NEXUS_REPO}/${EP_IMG_NAME}:${LATEST}"
32 DB_LATEST="${NEXUS_REPO}/${DB_IMG_NAME}:${LATEST}"
33 WMS_LATEST="${NEXUS_REPO}/${WMS_IMG_NAME}:${LATEST}"
34
35 # tag versions
36 docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APPS_VERSION}
37 docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APPS_LATEST}
38
39 docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_VERSION}
40 docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_LATEST}
41
42 docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_VERSION}
43 docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_LATEST}
44
45 # push to registry
46 docker push ${APPS_VERSION}
47 docker push ${APPS_LATEST}
48
49 docker push ${DB_VERSION}
50 docker push ${DB_LATEST}
51
52 docker push ${WMS_VERSION}
53 docker push ${WMS_LATEST}