#!/bin/bash # Read configuration files GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt) 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 # Download dependencies 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 openjdk-8-jdk maven # Clone Gerrit repository and run docker containers cd /opt git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO chmod +x /opt/authz/auth/auth-cass/docker/dinstall.sh chmod +x /opt/authz/auth/auth-cass/docker/backup/backup.sh chmod +x /opt/authz/auth/docker/dbuild.sh chmod +x /opt/authz/auth/docker/drun.sh chmod +x /opt/authz/auth/docker/dstart.sh chmod +x /opt/authz/auth/docker/dstop.sh #Update maven settings cat > /usr/share/maven/conf/settings.xml << EOF EOF if [[ $(cat /opt/config/https_proxy.txt) != "no_proxy" ]]; then HTTPS_PROXY_HOST=$(cat /opt/config/https_proxy.txt | cut -d ':' -f1) HTTPS_PROXY_PORT=$(cat /opt/config/https_proxy.txt | cut -d ':' -f2) cat >> settings.xml << EOF optional true http proxyuser proxypass $HTTPS_PROXY_HOST $HTTPS_PROXY_PORT local.net|some.host.com optional true https proxyuser proxypass $HTTPS_PROXY_HOST $HTTPS_PROXY_PORT local.net|some.host.com EOF fi cat >> settings.xml << EOF 10_nexus 10_nexus http://repo.maven.apache.org/maven2/ true true 10_nexus http://repo.maven.apache.org/maven2/ true true 20_openecomp-public 20_openecomp-public 20_openecomp-public https://nexus.onap.org/content/repositories/public/ true daily false 20_openecomp-public 20_openecomp-public https://nexus.onap.org/content/repositories/public/ true daily false 30_openecomp-staging 30_openecomp-staging 30_openecomp-staging https://nexus.onap.org/content/repositories/staging/ true daily false 30_openecomp-staging 30_openecomp-staging https://nexus.onap.org/content/repositories/staging/ true daily false 40_openecomp-release 40_openecomp-release 40_openecomp-release https://nexus.onap.org/content/repositories/releases/ true daily false 40_openecomp-release 40_openecomp-release https://nexus.onap.org/content/repositories/releases/ true daily false 50_openecomp-snapshots 50_openecomp-snapshot 50_openecomp-snapshot https://nexus.onap.org/content/repositories/snapshots/ false true 50_openecomp-snapshot 50_openecomp-snapshot https://nexus.onap.org/content/repositories/snapshots/ false true 60_opendaylight-release 60_opendaylight-mirror 60_opendaylight-mirror https://nexus.opendaylight.org/content/repositories/public/ true daily false 60_opendaylight-mirror 60_opendaylight-mirror https://nexus.opendaylight.org/content/repositories/public/ true daily false 70_opendaylight-snapshots 70_opendaylight-snapshot 70_opendaylight-snapshot https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ false true 70_opendaylight-snapshot 70_opendaylight-snapshot https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ false true 10_nexus 20_openecomp-public 30_openecomp-staging 40_openecomp-release 50_openecomp-snapshots 60_opendaylight-release 70_opendaylight-snapshots EOF cd /opt/authz mvn install -Dmaven.test.skip=true cd /opt ./aaf_vm_init.sh