aboutsummaryrefslogtreecommitdiffstats
path: root/boot/uui_vm_init.sh
blob: 01cee5f5edb3292664108e9e58ffc83dd9ff6214 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# 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/uui_docker.txt)

source /opt/config/onap_ips.txt

# Refresh images
docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
docker pull $NEXUS_DOCKER_REPO/onap/usecase-ui:$DOCKER_IMAGE_VERSION
docker pull $NEXUS_DOCKER_REPO/onap/usecase-ui/usecase-ui-server:$DOCKER_IMAGE_VERSION

docker rm -f uui_ui
docker rm -f uui_server

# Insert docker run instructions here
docker run -i -t -d --name uui_ui -p 8080:8080 -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/usecase-ui:$DOCKER_IMAGE_VERSION
docker run -i -t -d --name uui_server -p 8082:8082 -e MSB_ADDR=$OPENO_IP:80 -e MR_ADDR=$MR_IP:3904 $NEXUS_DOCKER_REPO/onap/usecase-ui/usecase-ui-server:$DOCKER_IMAGE_VERSION
="nv">CLI_INSTALL_DIR=/opt/onap/cli CLI_ZIP=cli.zip CLI_BIN=/usr/bin/onap HTTP_PROXY=$(cat /opt/config/http_proxy.txt) HTTPS_PROXY=$(cat /opt/config/https_proxy.txt) if [ $HTTP_PROXY != "no_proxy" ] then export http_proxy=$HTTP_PROXY export https_proxy=$HTTPS_PROXY fi export ONAP_CLI_HOME=$CLI_INSTALL_DIR export CLI_PRODUCT_VERSION=onap-1.1 #create install dir if [ -d $CLI_INSTALL_DIR ] then mv $CLI_INSTALL_DIR $CLI_INSTALL_DIR/../cli_`date +"%m-%d-%y-%H-%M-%S"` rm $CLI_BIN fi mkdir -p $CLI_INSTALL_DIR cd $CLI_INSTALL_DIR #Download and unzip CLI apt-get install -y wget unzip #check for java java -version if [ $? == 127 ] then apt-get install -y openjdk-8-jre fi wget -O $CLI_ZIP $CLI_LATEST_BINARY unzip $CLI_ZIP if [ ! -d ./data ]; then mkdir ./data; fi if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi chmod +x ./bin/onap.sh #Make onap available in path ln ./bin/onap.sh $CLI_BIN #Print the version onap -v cd -