blob: a6c1ba4834e734b4c08907be14c6ae5947f419aa [file] [log] [blame]
kishore328996f2017-09-08 17:15:42 -05001#!/bin/bash
2# Starts docker containers for ONAP Portal in Rackspace.
3# Version for Amsterdam/R1 uses docker-compose.
4
5# be verbose
6set -x
7
8# Establish environment variables
9NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt)
10NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt)
11NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
12DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
13
14# Refresh configuration and scripts
15cd /opt/portal
16git pull
17cd deliveries
18
19# Get image names used below from docker-compose environment file
20source .env
21
22# Copy property files
23ETC=/PROJECT/OpenSource/UbuntuEP/etc
24mkdir -p $ETC
25cp -r properties_rackspace/* $ETC
26
27# Refresh images
28docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
29docker pull $NEXUS_DOCKER_REPO/openecomp/${DB_IMG_NAME}:$DOCKER_IMAGE_VERSION
30docker pull $NEXUS_DOCKER_REPO/openecomp/${EP_IMG_NAME}:$DOCKER_IMAGE_VERSION
31docker pull $NEXUS_DOCKER_REPO/openecomp/${WMS_IMG_NAME}:$DOCKER_IMAGE_VERSION
32
33# Tag them as expected by docker-compose file
34docker tag $NEXUS_DOCKER_REPO/openecomp/${DB_IMG_NAME}:$DOCKER_IMAGE_VERSION $DB_IMG_NAME:$PORTAL_TAG
35docker tag $NEXUS_DOCKER_REPO/openecomp/${EP_IMG_NAME}:$DOCKER_IMAGE_VERSION $EP_IMG_NAME:$PORTAL_TAG
36docker tag $NEXUS_DOCKER_REPO/openecomp/${WMS_IMG_NAME}:$DOCKER_IMAGE_VERSION $WMS_IMG_NAME:$PORTAL_TAG
37
38# docker-compose is not in /usr/bin
39/opt/docker/docker-compose down
40/opt/docker/docker-compose up -d