blob: f01420cbdf18b7cd3e9939e2ae01b67d5beabd41 [file] [log] [blame]
Jun Hu07f67512017-11-17 14:13:49 -05001#!/bin/sh
2
Hong Guan9000c852018-05-02 13:25:14 -04003# ============LICENSE_START==========================================
4# ===================================================================
5# Copyright (c) 2017 AT&T
6#
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18#============LICENSE_END============================================
19
Jun Hu07f67512017-11-17 14:13:49 -050020#
21PUBIP="$1"
22PVTIP="$2"
23NEXUS_REPO="$3"
24DOCKER_REPO="$4"
25NEXUS_USERNAME="$5"
26NEXUS_PASSWORD="$6"
27ARTIFACTS_VERSION="$7"
28DNS_IP="$8"
29DOCKER_VERSION="$9"
30GERRIT_BRANCH="$10"
31CLOUD_ENV="$11"
32EXETERNAL_DNS="$12"
33POLICY_REPO="$13"
34
35export HOSTNAME=`hostname`
36echo 127.0.1.1 $HOSTNAME >>/etc/hosts
37echo $PVTIP $HOSTNAME >>/etc/hosts
38echo $PUBIP $HOSTNAME >>/etc/hosts
39
40
41mkdir /opt/config
42chmod 777 /opt/config
43echo $PUBIP > /opt/config/public_ip.txt
44echo $NEXUS_REPO > /opt/config/nexus_repo.txt
45echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt
46echo $NEXUS_USERNAME > /opt/config/nexus_username.txt
47echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt
48echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt
49echo $DNS_IP > /opt/config/dns_ip_addr.txt
50echo $DOCKER_VERSION > /opt/config/docker_version.txt
51echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt
52echo $CLOUD_ENV > /opt/config/cloud_env.txt
53echo $EXETERNAL_DNS > /opt/config/external_dns.txt
54echo $POLICY_REPO > /opt/config/remote_repo.txt
55touch /opt/policy_install.sh
56chmod 777 /opt/policy_install.sh
57curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/policy_install.sh -o /opt/policy_install.sh;
58apt-get update
59apt-get install -y docker.io
60cd /opt
61chmod +x policy_install.sh
62/opt/policy_install.sh > policy_install.log 2>&1