X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=boot%2Fpolicy_install.sh;h=6394fc181b8012bfdef0c445dfa4c69af6557baa;hb=16f7357930c846a1163fc124bd82267be914512f;hp=3f6ea5d150eb6c19917082d5404c7d464e2a2a6a;hpb=382ee4313cc53c7f16699438496098ed0dd68fb5;p=demo.git diff --git a/boot/policy_install.sh b/boot/policy_install.sh index 3f6ea5d1..6394fc18 100644 --- a/boot/policy_install.sh +++ b/boot/policy_install.sh @@ -1,13 +1,20 @@ #!/bin/bash # Read configuration files -NEXUS_REPO=$(cat /opt/config/nexus_repo.txt) ARTIFACTS_VERSION=$(cat /opt/config/artifacts_version.txt) DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.txt) GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt) MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) CODE_REPO=$(cat /opt/config/remote_repo.txt) +HTTP_PROXY=$(cat /opt/config/http_proxy.txt) +HTTPS_PROXY=$(cat /opt/config/https_proxy.txt) + +if [ $HTTP_PROXY != "no_proxy" ] +then + export http_proxy=$HTTP_PROXY + export https_proxy=$HTTPS_PROXY +fi # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -54,8 +61,10 @@ apt-get update apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/policy_vm_init.sh -o /opt/policy_vm_init.sh -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/policy_serv.sh -o /opt/policy_serv.sh +unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip policy_vm_init.sh > /opt/policy_vm_init.sh +unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip policy_serv.sh > /opt/policy_serv.sh +unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh +chmod +x /opt/imagetest.sh chmod +x /opt/policy_vm_init.sh chmod +x /opt/policy_serv.sh mv /opt/policy_serv.sh /etc/init.d @@ -85,6 +94,11 @@ echo "DOCKER_OPTS=\"$DNS_FLAG--mtu=$MTU\"" >> /etc/default/docker cp /lib/systemd/system/docker.service /etc/systemd/system sed -i "/ExecStart/s/$/ --mtu=$MTU/g" /etc/systemd/system/docker.service +if [ $HTTP_PROXY != "no_proxy" ] +then +cd /opt +./imagetest.sh +fi service docker restart # DNS IP address configuration