Jun Hu | ad41506 | 2017-11-21 14:53:15 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Hong Guan | 9000c85 | 2018-05-02 13:25:14 -0400 | [diff] [blame] | 3 | # ============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 Hu | ad41506 | 2017-11-21 14:53:15 -0500 | [diff] [blame] | 20 | # |
| 21 | PUBIP="$1" |
| 22 | PVTIP="$2" |
| 23 | NEXUS_REPO="$3" |
| 24 | DOCKER_REPO="$4" |
| 25 | NEXUS_USERNAME="$5" |
| 26 | NEXUS_PASSWORD="$6" |
| 27 | ARTIFACTS_VERSION="$7" |
| 28 | DNS_IP="$8" |
| 29 | GERRIT_BRANCH="$9" |
| 30 | CLOUD_ENV="$10" |
| 31 | EXETERNAL_DNS="$11" |
| 32 | MR_REPO="$12" |
| 33 | |
| 34 | export HOSTNAME=`hostname` |
| 35 | echo 127.0.1.1 $HOSTNAME >>/etc/hosts |
| 36 | echo $PVTIP $HOSTNAME >>/etc/hosts |
| 37 | echo $PUBIP $HOSTNAME >>/etc/hosts |
| 38 | |
| 39 | |
| 40 | mkdir /opt/config |
| 41 | chmod 777 /opt/config |
| 42 | echo $PUBIP > /opt/config/public_ip.txt |
| 43 | echo $NEXUS_REPO > /opt/config/nexus_repo.txt |
| 44 | echo $DOCKER_REPO > /opt/config/nexus_docker_repo.txt |
| 45 | echo $NEXUS_USERNAME > /opt/config/nexus_username.txt |
| 46 | echo $NEXUS_PASSWORD > /opt/config/nexus_password.txt |
| 47 | echo $ARTIFACTS_VERSION > /opt/config/artifacts_version.txt |
| 48 | echo $DNS_IP > /opt/config/dns_ip_addr.txt |
| 49 | echo $GERRIT_BRANCH > /opt/config/gerrit_branch.txt |
| 50 | echo $CLOUD_ENV > /opt/config/cloud_env.txt |
| 51 | echo $EXETERNAL_DNS > /opt/config/external_dns.txt |
| 52 | echo $MR_REPO > /opt/config/remote_repo.txt |
| 53 | |
| 54 | touch /opt/mr_install.sh |
| 55 | chmod 777 /opt/mr_install.sh |
| 56 | curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/mr_install.sh -o /opt/mr_install.sh; |
| 57 | cd /opt |
| 58 | chmod +x mr_install.sh |
| 59 | /opt/mr_install.sh > mr_install.log 2>&1 |