blob: 66cedd9b3acfac1ffdefc604ada579d5ae997c96 [file] [log] [blame]
Jun Hu07f67512017-11-17 14:13:49 -05001#!/bin/sh
2
3#
4PUBIP="$1"
5PVTIP="$2"
6NEXUS_REPO="$3"
7DOCKER_REPO="$4"
8NEXUS_USERNAME="$5"
9NEXUS_PASSWORD="$6"
10ARTIFACTS_VERSION="$7"
11DNS_IP="$8"
12DOCKER_VERSION="$9"
13GERRIT_BRANCH="$10"
14CLOUD_ENV="$11"
15EXETERNAL_DNS="$12"
16POLICY_REPO="$13"
17
18export HOSTNAME=`hostname`
19echo 127.0.1.1 $HOSTNAME >>/etc/hosts
20echo $PVTIP $HOSTNAME >>/etc/hosts
21echo $PUBIP $HOSTNAME >>/etc/hosts
22
23
24mkdir /opt/config
25chmod 777 /opt/config
26echo $PUBIP > /opt/config/public_ip.txt
27echo $NEXUS_REPO > /opt/config/nexus_repo.txt
28echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt
29echo $NEXUS_USERNAME > /opt/config/nexus_username.txt
30echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt
31echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt
32echo $DNS_IP > /opt/config/dns_ip_addr.txt
33echo $DOCKER_VERSION > /opt/config/docker_version.txt
34echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt
35echo $CLOUD_ENV > /opt/config/cloud_env.txt
36echo $EXETERNAL_DNS > /opt/config/external_dns.txt
37echo $POLICY_REPO > /opt/config/remote_repo.txt
38touch /opt/policy_install.sh
39chmod 777 /opt/policy_install.sh
40curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/policy_install.sh -o /opt/policy_install.sh;
41apt-get update
42apt-get install -y docker.io
43cd /opt
44chmod +x policy_install.sh
45/opt/policy_install.sh > policy_install.log 2>&1