blob: e570a9ddb918d3c564250ee199da14a538e75505 [file] [log] [blame]
Hong Guan62f78a62017-11-21 11:00:42 -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"
12GERRIT_BRANCH="$9"
13CLOUD_ENV="$10"
14EXETERNAL_DNS="$11"
15DMAAP_TOPIC="$12"
16OPENSTACK_USERNAME="$13"
17TENANT_ID="$14"
18OPENSTACK_API_KEY="$15"
19OPENSTACK_REGION="$16"
20KEYSTONE="$17"
21SO_REPO="$18"
22DOCKER_VERSION="$19"
23
24export HOSTNAME=`hostname`
25echo 127.0.1.1 $HOSTNAME >>/etc/hosts
26echo $PVTIP $HOSTNAME >>/etc/hosts
27echo $PUBIP $HOSTNAME >>/etc/hosts
28
29
30mkdir /opt/config
31chmod 777 /opt/config
32echo $PUBIP > /opt/config/public_ip.txt
33echo $NEXUS_REPO > /opt/config/nexus_repo.txt
34echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt
35echo $NEXUS_USERNAME > /opt/config/nexus_username.txt
36echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt
37echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt
38echo $DNS_IP > /opt/config/dns_ip_addr.txt
39echo $DOCKER_VERSION > /opt/config/docker_version.txt
40echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt
41echo $CLOUD_ENV > /opt/config/cloud_env.txt
42echo $EXETERNAL_DNS > /opt/config/external_dns.txt
43echo $DMAAP_TOPIC > /opt/config/dmaap_topic.txt
44echo $OPENSTACK_USERNAME > /opt/config/openstack_username.txt
45echo $TENANT_ID > /opt/config/tenant_id.txt
46echo $OPENSTACK_API_KEY > /opt/config/openstack_api_key.txt
47echo $OPENSTACK_REGION > /opt/config/openstack_region.txt
48echo $KEYSTONE > /opt/config/keystone.txt
49echo $SO_REPO > /opt/config/remote_repo.txt
50
51if [ ! -f /opt/rebooted ]; then
52 touch /opt/so_install.sh
53 chmod 777 /opt/so_install.sh
54 curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/so_install.sh -o /opt/so_install.sh
55 cd /opt
56 chmod +x so_install.sh
57
58 echo " if [ ! -f /opt/rebooted ]; then" >/opt/install_tmp
59 echo " touch /opt/rebooted">>/opt/install_tmp
60 echo " reboot" >>/opt/install_tmp
61 echo " fi">>/opt/install_tmp
62 sed -i -e "/\treboot/r install_tmp" -e "//d" so_install.sh
63fi
64/opt/so_install.sh > so_install.log 2>&1