Christopher Lott (cl778h) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 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 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 17 | # 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) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 20 | |
st782s | 8bcc6f6 | 2018-02-05 16:14:27 -0500 | [diff] [blame] | 21 | # Establish environment variables |
| 22 | source $(dirname $0)/.env |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 23 | if [ $1 ]; then |
| 24 | source $(dirname $0)/$1 |
| 25 | fi |
st782s | 8bcc6f6 | 2018-02-05 16:14:27 -0500 | [diff] [blame] | 26 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 27 | # Build the containers |
| 28 | if [ "$SKIP_BUILD_BEFORE_PUSH" = "please" ]; then |
| 29 | echo "SKIPPING DOCKER IMAGE BUILD!" |
| 30 | else |
| 31 | ./build_portalapps_dockers.sh $1 |
| 32 | fi |
Christopher Lott (cl778h) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 33 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 34 | if [ "${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) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 37 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 38 | docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APP_VERSION} |
| 39 | docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APP_LATEST} |
Kishore Reddy, Gujja (kg811t) | 4ee8967 | 2018-03-20 17:15:25 -0400 | [diff] [blame] | 40 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 41 | docker push ${APP_VERSION} |
| 42 | docker push ${APP_LATEST} |
| 43 | fi |
Christopher Lott (cl778h) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 44 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 45 | if [ "${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) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 48 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 49 | docker tag ${SDK_IMG_NAME}:${PORTAL_TAG} ${SDK_VERSION} |
| 50 | docker tag ${SDK_IMG_NAME}:${PORTAL_TAG} ${SDK_LATEST} |
Christopher Lott (cl778h) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 51 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 52 | docker push ${SDK_VERSION} |
| 53 | docker push ${SDK_LATEST} |
| 54 | fi |
Kishore Reddy, Gujja (kg811t) | 4ee8967 | 2018-03-20 17:15:25 -0400 | [diff] [blame] | 55 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 56 | if [ "${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) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 59 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 60 | docker tag ${FE_IMG_NAME}:${PORTAL_TAG} ${FE_VERSION} |
| 61 | docker tag ${FE_IMG_NAME}:${PORTAL_TAG} ${FE_LATEST} |
Christopher Lott (cl778h) | 978dbcf | 2017-08-23 18:27:19 -0400 | [diff] [blame] | 62 | |
Sudarshan Kumar | 8e83c25 | 2020-02-18 16:16:26 +0530 | [diff] [blame] | 63 | docker push ${FE_VERSION} |
| 64 | docker push ${FE_LATEST} |
| 65 | fi |
| 66 | |
| 67 | if [ "${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} |
| 76 | fi |
| 77 | |
| 78 | if [ "${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} |
| 87 | fi |
| 88 | |
| 89 | if [ "${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} |
| 98 | fi |
| 99 | |