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