aboutsummaryrefslogtreecommitdiffstats
path: root/boot/portal_vm_init.sh
blob: 176400584c807c72f164aef3dc1cf90621c8a6c0 (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
54
55
56
57
#!/bin/bash
# Starts docker containers for ONAP Portal in Rackspace.
# Version for Amsterdam/R1 uses docker-compose.

# be verbose
set -x

# Establish environment variables
NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt)
NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt)
NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt)
# Use "latest" to deploy snapshot images:
# DOCKER_IMAGE_VERSION=latest
CLI_DOCKER_VERSION=$(cat /opt/config/cli_docker_version.txt)
CDR_IMAGE_VERSION=latest
ZK_IMAGE_VERSION=3.4

# Refresh configuration and scripts
cd /opt/portal
git pull
cd deliveries

# Get image names used below from docker-compose environment file
source .env

# Refresh images
docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
docker pull $NEXUS_DOCKER_REPO/$DB_IMG_NAME:$DOCKER_IMAGE_VERSION
docker pull $NEXUS_DOCKER_REPO/$EP_IMG_NAME:$DOCKER_IMAGE_VERSION
docker pull $NEXUS_DOCKER_REPO/$SDK_IMG_NAME:$DOCKER_IMAGE_VERSION
docker pull $NEXUS_DOCKER_REPO/$CDR_IMG_NAME:$CDR_IMAGE_VERSION
docker pull $ZK_IMG_NAME:$ZK_IMAGE_VERSION
docker pull $NEXUS_DOCKER_REPO/$WMS_IMG_NAME:$DOCKER_IMAGE_VERSION
docker pull $NEXUS_DOCKER_REPO/$CLI_IMG_NAME:$CLI_DOCKER_VERSION

# Tag them as expected by docker-compose file
docker tag $NEXUS_DOCKER_REPO/$DB_IMG_NAME:$DOCKER_IMAGE_VERSION $DB_IMG_NAME:$PORTAL_TAG
docker tag $NEXUS_DOCKER_REPO/$EP_IMG_NAME:$DOCKER_IMAGE_VERSION $EP_IMG_NAME:$PORTAL_TAG
docker tag $NEXUS_DOCKER_REPO/$SDK_IMG_NAME:$DOCKER_IMAGE_VERSION $SDK_IMG_NAME:$PORTAL_TAG
docker tag $NEXUS_DOCKER_REPO/$CDR_IMG_NAME:$CDR_IMAGE_VERSION $CDR_IMG_NAME:$PORTAL_TAG
docker tag $ZK_IMG_NAME:$ZK_IMAGE_VERSION $ZK_IMG_NAME:$PORTAL_TAG
docker tag $NEXUS_DOCKER_REPO/$WMS_IMG_NAME:$DOCKER_IMAGE_VERSION $WMS_IMG_NAME:$PORTAL_TAG
docker tag $NEXUS_DOCKER_REPO/$CLI_IMG_NAME:$CLI_DOCKER_VERSION $CLI_IMG_NAME:$PORTAL_TAG

# Export variable for local logs directory, and create directory too
# The leading "./" is required for docker-compose
export LOGS_DIR=./logs
mkdir -p $LOGS_DIR

# Export variable for subdirectory with appropriate property files
# The leading "./" is required for docker-compose
export PROPS_DIR=./properties_simpledemo

# docker-compose is not in /usr/bin
/opt/docker/docker-compose down
/opt/docker/docker-compose up -d
t">"no-console": [ true, "debug", "info", "time", "timeEnd", "trace" ], "no-construct": true, "no-debugger": true, "no-empty": true, "no-empty-interface": true, "no-eval": true, "no-inferrable-types": false, "no-shadowed-variable": true, "no-string-literal": true, "no-string-throw": true, "no-switch-case-fall-through": true, "no-trailing-whitespace": true, "no-unused-expression": [ true, "allow-fast-null-checks" ], "no-var-keyword": true, "object-literal-sort-keys": false, "one-line": [ true, "check-open-brace", "check-catch", "check-else", "check-whitespace" ], "prefer-const": true, "quotemark": [ true, "single" ], "semicolon": [ true, "always" ], "triple-equals": [ true, "allow-null-check", "allow-undefined-check" ], "typedef-whitespace": [ true, { "call-signature": "nospace", "index-signature": "nospace", "parameter": "nospace", "property-declaration": "nospace", "variable-declaration": "nospace" } ], "variable-name": [ true, "check-format", "ban-keywords" ], "whitespace": [ true, "check-branch", "check-decl", "check-operator", "check-module", "check-separator", "check-type", "check-preblock" ], "ban-types": [ true, [ "Object", "Avoid using the `Object` type. Did you mean `object`?" ], [ "Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?" ], [ "Number", "Avoid using the `Number` type. Did you mean `number`?" ], [ "String", "Avoid using the `String` type. Did you mean `string`?" ], [ "Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?" ] ] } }