summaryrefslogtreecommitdiffstats
path: root/deliveries/os_docker_base.sh
blob: 3f110003d493511d2e218979fca0a0aa61be390d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# Builds and pushes versions of Portal images
# Invoked by scripts that set VERSION and LATEST

# be verbose
set -x 

if [ -z "$VERSION" ]; then
    echo "VERSION not set"
    exit 1
fi
if [ -z "$LATEST" ]; then
    echo "LATEST not set"
    exit 1
fi

# ONAP docker registry for pushing; may need to move
# this into os_docker_push, os_docker_release scripts
NEXUS_REPO=nexus3.onap.org:10003

# Establish environment variables
source $(dirname $0)/.env

# Build the containers
./build_portalapps_dockers.sh

APPS_VERSION="${NEXUS_REPO}/${EP_IMG_NAME}:${VERSION}"
DB_VERSION="${NEXUS_REPO}/${DB_IMG_NAME}:${VERSION}"
WMS_VERSION="${NEXUS_REPO}/${WMS_IMG_NAME}:${VERSION}"

APPS_LATEST="${NEXUS_REPO}/${EP_IMG_NAME}:${LATEST}"
DB_LATEST="${NEXUS_REPO}/${DB_IMG_NAME}:${LATEST}"
WMS_LATEST="${NEXUS_REPO}/${WMS_IMG_NAME}:${LATEST}"

# tag versions
docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APPS_VERSION}
docker tag ${EP_IMG_NAME}:${PORTAL_TAG} ${APPS_LATEST}

docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_VERSION}
docker tag ${DB_IMG_NAME}:${PORTAL_TAG} ${DB_LATEST}

docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_VERSION}
docker tag ${WMS_IMG_NAME}:${PORTAL_TAG} ${WMS_LATEST}

# push to registry
docker push ${APPS_VERSION}
docker push ${APPS_LATEST}

docker push ${DB_VERSION}
docker push ${DB_LATEST}

docker push ${WMS_VERSION}
docker push ${WMS_LATEST}