X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=vnfs%2FvLBMS%2Fscripts%2Fv_dns_install.sh;h=9f48b391dc5babb0da770a6a347fc119f1b78e9b;hb=5cbe653d94ff73d172f95f701856235c184c4657;hp=38860e8e8984147ff3cd21c5b1b5663456baffc3;hpb=d8ff19612d74d1ace0947294f774c9ef0c992de0;p=demo.git diff --git a/vnfs/vLBMS/scripts/v_dns_install.sh b/vnfs/vLBMS/scripts/v_dns_install.sh index 38860e8e..9f48b391 100644 --- a/vnfs/vLBMS/scripts/v_dns_install.sh +++ b/vnfs/vLBMS/scripts/v_dns_install.sh @@ -1,8 +1,7 @@ #!/bin/bash -REPO_URL_BLOB=$(cat /opt/config/repo_url_blob.txt) -REPO_URL_ARTIFACTS=$(cat /opt/config/repo_url_artifacts.txt) -DEMO_ARTIFACTS_VERSION=$(cat /opt/config/demo_artifacts_version.txt) +NEXUS_ARTIFACT_REPO=$(cat /opt/config/nexus_artifact_repo.txt) +NB_API_VERSION=$(cat /opt/config/nb_api_version.txt) INSTALL_SCRIPT_VERSION=$(cat /opt/config/install_script_version.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.txt) @@ -48,35 +47,154 @@ fi echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install --allow-unauthenticated -y wget openjdk-8-jdk bind9 bind9utils bind9-doc apt-transport-https ca-certificates maven +apt-get install --allow-unauthenticated -y wget openjdk-8-jdk bind9 bind9utils bind9-doc apt-transport-https ca-certificates git maven sleep 1 # Download vDNS demo code for DNS Server cd /opt -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlbms/$INSTALL_SCRIPT_VERSION/v_dns_init.sh -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlbms/$INSTALL_SCRIPT_VERSION/vdns.sh -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlbms/$INSTALL_SCRIPT_VERSION/set_gre_tunnel.sh -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlbms/$INSTALL_SCRIPT_VERSION/properties.conf -O /opt/config/properties.conf -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlbms/$INSTALL_SCRIPT_VERSION/run_health_vdns.sh -O /opt/run_health.sh +unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip v_dns_init.sh > /opt/v_dns_init.sh +unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip vdns.sh > /opt/vdns.sh +unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip set_gre_tunnel.sh > /opt/set_gre_tunnel.sh +unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip properties.conf > /opt/config/properties.conf +unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip run_health_vdns.sh > /opt/run_health.sh sed -i 's/primary=.*/primary=false/g' /opt/config/properties.conf sed -i 's/vnfc=.*/vnfc=vDNS/g' /opt/config/properties.conf -mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=https://nexus.onap.org/content/repositories/snapshots -Dartifact=org.onap.demo.vnf.vlb:vlb-vnf-onap-distribution:$DEMO_ARTIFACTS_VERSION-SNAPSHOT:tar.gz:hc -Dtransitive=false -Ddest=. -tar -zmxvf vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT-hc.tar.gz -rm vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT.tar.gz -sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT/config/honeycomb.json -sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT/config/honeycomb.json +# Clone Honeycomb interface for the VNF component +mkdir honeycomb-api +git init honeycomb-api +cd honeycomb-api +git remote add origin https://gerrit.onap.org/r/demo.git +git config core.sparsecheckout true +echo "vnfs/vLBMS/apis" >> .git/info/sparse-checkout +git pull --depth=1 origin master + +mkdir ~/.m2 +cat > ~/.m2/settings.xml << EOF + + + + + + + fd.io-release + + + fd.io-mirror + fd.io-mirror + https://nexus.fd.io/content/groups/public/ + + true + never + + + false + + + + + + fd.io-mirror + fd.io-mirror + https://nexus.fd.io/content/repositories/public/ + + true + never + + + false + + + + + + + fd.io-snapshots + + + fd.io-snapshot + fd.io-snapshot + https://nexus.fd.io/content/repositories/fd.io.snapshot/ + + false + + + true + + + + + + fd.io-snapshot + fd.io-snapshot + https://nexus.fd.io/content/repositories/fd.io.snapshot/ + + false + + + true + + + + + + opendaylight-snapshots + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + opendaylight-shapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + + + fd.io-release + fd.io-snapshots + opendaylight-snapshots + + +EOF + +cd /opt/honeycomb-api/vnfs/vLBMS/apis +mvn clean install + +sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' /opt/honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$NB_API_VERSION-hc/vlb-vnf-onap-distribution-$NB_API_VERSION/config/honeycomb.json +sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' /opt/honeycomb-api/vnfs/vLBMS/apis/vlb-vnf-onap-distribution/target/vlb-vnf-onap-distribution-$NB_API_VERSION-hc/vlb-vnf-onap-distribution-$NB_API_VERSION/config/honeycomb.json +cd /opt chmod +x v_dns_init.sh chmod +x vdns.sh chmod +x set_gre_tunnel.sh +chmod +x run_health.sh # Download Bind config files -cd /opt/config -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlbms/$INSTALL_SCRIPT_VERSION/db_dnsdemo_onap_org -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlbms/$INSTALL_SCRIPT_VERSION/named.conf.options -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlbms/$INSTALL_SCRIPT_VERSION/named.conf.local +unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip db_dnsdemo_onap_org > /opt/db_dnsdemo_onap_org +unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip named.conf.options > /opt/named.conf.options +unzip -p -j /opt/vlbms-scripts-$INSTALL_SCRIPT_VERSION.zip named.conf.local > /opt/named.conf.local echo "bind9" > service.txt @@ -90,7 +208,6 @@ mv named.conf.local /etc/bind/ sleep 1 # Run instantiation script -cd /opt mv vdns.sh /etc/init.d update-rc.d vdns.sh defaults