Hong Guan | ec17544 | 2017-11-20 16:46:51 -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 | GERRIT_BRANCH="$9" |
| 13 | CLOUD_ENV="$10" |
| 14 | EXETERNAL_DNS="$11" |
| 15 | DMAAP_TOPIC="$12" |
| 16 | OPENSTACK_USERNAME="$13" |
| 17 | TENANT_ID="$14" |
| 18 | OPENSTACK_API_KEY="$15" |
| 19 | OPENSTACK_REGION="$16" |
| 20 | KEYSTONE="$17" |
| 21 | APPC_REPO="$18" |
| 22 | DOCKER_VERSION="$19" |
| 23 | DGBUILDER_DOCKER="$20" |
| 24 | |
| 25 | export HOSTNAME=`hostname` |
| 26 | echo 127.0.1.1 $HOSTNAME >>/etc/hosts |
| 27 | echo $PVTIP $HOSTNAME >>/etc/hosts |
| 28 | echo $PUBIP $HOSTNAME >>/etc/hosts |
| 29 | |
| 30 | |
| 31 | mkdir /opt/config |
| 32 | chmod 777 /opt/config |
| 33 | echo $PUBIP > /opt/config/public_ip.txt |
| 34 | echo $NEXUS_REPO > /opt/config/nexus_repo.txt |
| 35 | echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt |
| 36 | echo $NEXUS_USERNAME > /opt/config/nexus_username.txt |
| 37 | echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt |
| 38 | echo $DMAAP_TOPIC > /opt/config/dmaap_topic.txt |
| 39 | echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt |
| 40 | echo $DNS_IP > /opt/config/dns_ip_addr.txt |
| 41 | echo $DOCKER_VERSION > /opt/config/docker_version.txt |
| 42 | echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt |
| 43 | echo $DGBUILDER_DOCKER > /opt/config/dgbuilder_version.txt |
| 44 | echo $CLOUD_ENV > /opt/config/cloud_env.txt |
| 45 | echo $EXETERNAL_DNS > /opt/config/external_dns.txt |
| 46 | echo $APPC_REPO > /opt/config/remote_repo.txt |
| 47 | echo $OPENSTACK_USERNAME > /opt/config/openstack_username.txt |
| 48 | echo $TENANT_ID > /opt/config/tenant_id.txt |
| 49 | echo $OPENSTACK_API_KEY > /opt/config/openstack_api_key.txt |
| 50 | echo $OPENSTACK_REGION > /opt/config/openstack_region.txt |
| 51 | echo $KEYSTONE > /opt/config/keystone.txt |
| 52 | |
| 53 | touch /opt/appc_install.sh |
| 54 | chmod 777 /opt/appc_install.sh |
| 55 | curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/appc_install.sh -o /opt/appc_install.sh |
| 56 | cd /opt |
| 57 | chmod +x appc_install.sh |
| 58 | /opt/appc_install.sh > appc_install.log 2>&1 |