blob: b2a32a78040ee841fec72420b1e85090d3510396 [file] [log] [blame]
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -04001#!/bin/bash
2# Builds and pushes versions of Portal images
3# Invoked by scripts that set VERSION and LATEST
4
5# be verbose
6set -x
7
8if [ -z "$VERSION" ]; then
9 echo "VERSION not set"
10 exit 1
11fi
12if [ -z "$LATEST" ]; then
13 echo "LATEST not set"
14 exit 1
15fi
16
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053017# ONAP docker registry for pushing; has been moved to
18# .env (or other .env override file from command line)
19# NEXUS_REPO=nexus3.onap.org:10003
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -040020
st782s8bcc6f62018-02-05 16:14:27 -050021# Establish environment variables
22source $(dirname $0)/.env
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053023if [ $1 ]; then
24 source $(dirname $0)/$1
25fi
st782s8bcc6f62018-02-05 16:14:27 -050026
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053027# Build the containers
28if [ "$SKIP_BUILD_BEFORE_PUSH" = "please" ]; then
29 echo "SKIPPING DOCKER IMAGE BUILD!"
30else
31 ./build_portalapps_dockers.sh $1
32fi
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -040033
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053034if [ "${PORTAL_DOCKERFILE}" != "skip" ] && [ "${EP_IMG_NAME}" != "skip" ]; then
35 APP_VERSION="${NEXUS_REPO}/${EP_IMG_NAME}:${VERSION}"
36 APP_LATEST="${NEXUS_REPO}/${EP_IMG_NAME}:${LATEST}"
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -040037
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053038 docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APP_VERSION}
39 docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APP_LATEST}
Kishore Reddy, Gujja (kg811t)4ee89672018-03-20 17:15:25 -040040
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053041 docker push ${APP_VERSION}
42 docker push ${APP_LATEST}
43fi
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -040044
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053045if [ "${SDK_DOCKERFILE}" != "skip" ] && [ "${SDK_IMG_NAME}" != "skip" ]; then
46 SDK_VERSION="${NEXUS_REPO}/${SDK_IMG_NAME}:${VERSION}"
47 SDK_LATEST="${NEXUS_REPO}/${SDK_IMG_NAME}:${LATEST}"
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -040048
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053049 docker tag ${SDK_IMG_NAME}:${PORTAL_TAG} ${SDK_VERSION}
50 docker tag ${SDK_IMG_NAME}:${PORTAL_TAG} ${SDK_LATEST}
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -040051
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053052 docker push ${SDK_VERSION}
53 docker push ${SDK_LATEST}
54fi
Kishore Reddy, Gujja (kg811t)4ee89672018-03-20 17:15:25 -040055
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053056if [ "${FE_DOCKERFILE}" != "skip" ] && [ "${FE_IMG_NAME}" != "skip" ]; then
57 FE_VERSION="${NEXUS_REPO}/${FE_IMG_NAME}:${VERSION}"
58 FE_LATEST="${NEXUS_REPO}/${FE_IMG_NAME}:${LATEST}"
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -040059
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053060 docker tag ${FE_IMG_NAME}:${PORTAL_TAG} ${FE_VERSION}
61 docker tag ${FE_IMG_NAME}:${PORTAL_TAG} ${FE_LATEST}
Christopher Lott (cl778h)978dbcf2017-08-23 18:27:19 -040062
Sudarshan Kumar8e83c252020-02-18 16:16:26 +053063 docker push ${FE_VERSION}
64 docker push ${FE_LATEST}
65fi
66
67if [ "${BE_DOCKERFILE}" != "skip" ] && [ "${BE_IMG_NAME}" != "skip" ]; then
68 BE_VERSION="${NEXUS_REPO}/${BE_IMG_NAME}:${VERSION}"
69 BE_LATEST="${NEXUS_REPO}/${BE_IMG_NAME}:${LATEST}"
70
71 docker tag ${BE_IMG_NAME}:${PORTAL_TAG} ${BE_VERSION}
72 docker tag ${BE_IMG_NAME}:${PORTAL_TAG} ${BE_LATEST}
73
74 docker push ${BE_VERSION}
75 docker push ${BE_LATEST}
76fi
77
78if [ "${DB_DOCKERFILE}" != "skip" ] && [ "${DB_IMG_NAME}" != "skip" ]; then
79 DB_VERSION="${NEXUS_REPO}/${DB_IMG_NAME}:${VERSION}"
80 DB_LATEST="${NEXUS_REPO}/${DB_IMG_NAME}:${LATEST}"
81
82 docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_VERSION}
83 docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_LATEST}
84
85 docker push ${DB_VERSION}
86 docker push ${DB_LATEST}
87fi
88
89if [ "${WMS_DOCKERFILE}" != "skip" ] && [ "${WMS_IMG_NAME}" != "skip" ]; then
90 WMS_VERSION="${NEXUS_REPO}/${WMS_IMG_NAME}:${VERSION}"
91 WMS_LATEST="${NEXUS_REPO}/${WMS_IMG_NAME}:${LATEST}"
92
93 docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_VERSION}
94 docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_LATEST}
95
96 docker push ${WMS_VERSION}
97 docker push ${WMS_LATEST}
98fi
99