4 VPP_SOURCE_REPO_URL=$(cat /opt/config/vpp_source_repo_url.txt)
5 VPP_SOURCE_REPO_RELEASE_TAG=$(cat /opt/config/vpp_source_repo_release_tag.txt)
6 HC2VPP_SOURCE_REPO_URL=$(cat /opt/config/hc2vpp_source_repo_url.txt)
7 HC2VPP_SOURCE_REPO_RELEASE_TAG=$(cat /opt/config/hc2vpp_source_repo_release_tag.txt)
8 CLOUD_ENV=$(cat /opt/config/cloud_env.txt)
9 ERROR_MESSAGE= "Execution of vGbuild script failed. Reason:"
11 # Download required dependencies
12 echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list
13 echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list
14 apt-get --allow-unauthenticated update
15 apt-get install --allow-unauthenticated -y wget openjdk-8-jdk apt-transport-https ca-certificates g++ libcurl4-gnutls-dev
18 # Install the tools required for download codes
19 apt-get --allow-unauthenticated install -y expect git make linux-image-extra-`uname -r`
22 apt-get install -y isc-dhcp-server
24 #Download and build the VPP codes
26 git clone ${VPP_SOURCE_REPO_URL} -b ${VPP_SOURCE_REPO_RELEASE_TAG} vpp
29 yes Y | make install-dep
31 # Check vpp build status
34 echo '$ERROR_MESSAGE VPP build failed' > /opt/script_status.txt
40 make V=0 PLATFORM=vpp TAG=vpp install-deb
42 # Check vpp/build-root build status
45 echo '$ERROR_MESSAGE VPP/build-root build failed' > /opt/script_status.txt
49 apt --allow-unauthenticated install -y python-ply-lex-3.5 python-ply-yacc-3.5 python-pycparser python-cffi
51 # Install the VPP package
54 # Check vpp package installation status
57 echo '$ERROR_MESSAGE VPP package installation failed' > /opt/script_status.txt
64 # Download and install HC2VPP from source
66 git clone ${HC2VPP_SOURCE_REPO_URL} -b ${HC2VPP_SOURCE_REPO_RELEASE_TAG} hc2vpp
67 apt-get install -y maven
69 cat > ~/.m2/settings.xml << EOF
70 <?xml version="1.0" encoding="UTF-8"?>
71 <!-- vi: set et smarttab sw=2 tabstop=2: -->
72 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
73 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
74 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
78 <id>fd.io-release</id>
82 <name>fd.io-mirror</name>
83 <url>https://nexus.fd.io/content/groups/public/</url>
85 <enabled>true</enabled>
86 <updatePolicy>never</updatePolicy>
89 <enabled>false</enabled>
96 <name>fd.io-mirror</name>
97 <url>https://nexus.fd.io/content/repositories/public/</url>
99 <enabled>true</enabled>
100 <updatePolicy>never</updatePolicy>
103 <enabled>false</enabled>
106 </pluginRepositories>
110 <id>fd.io-snapshots</id>
113 <id>fd.io-snapshot</id>
114 <name>fd.io-snapshot</name>
115 <url>https://nexus.fd.io/content/repositories/fd.io.snapshot/</url>
117 <enabled>false</enabled>
120 <enabled>true</enabled>
126 <id>fd.io-snapshot</id>
127 <name>fd.io-snapshot</name>
128 <url>https://nexus.fd.io/content/repositories/fd.io.snapshot/</url>
130 <enabled>false</enabled>
133 <enabled>true</enabled>
136 </pluginRepositories>
139 <id>opendaylight-snapshots</id>
142 <id>opendaylight-snapshot</id>
143 <name>opendaylight-snapshot</name>
144 <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
146 <enabled>false</enabled>
149 <enabled>true</enabled>
155 <id>opendaylight-shapshot</id>
156 <name>opendaylight-snapshot</name>
157 <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
159 <enabled>false</enabled>
162 <enabled>true</enabled>
165 </pluginRepositories>
170 <activeProfile>fd.io-release</activeProfile>
171 <activeProfile>fd.io-snapshots</activeProfile>
172 <activeProfile>opendaylight-snapshots</activeProfile>
180 # Check hc2vpp build status
183 echo '$ERROR_MESSAGE hc2vpp build failed' > /opt/script_status.txt
187 l_version=$(cat pom.xml | grep "<version>" | head -1)
188 l_version=$(echo "${l_version%<*}")
189 l_version=$(echo "${l_version#*>}")
190 mv vpp-integration/minimal-distribution/target/vpp-integration-distribution-${l_version}-hc/vpp-integration-distribution-${l_version} /opt/honeycomb
191 sed -i 's/127.0.0.1/0.0.0.0/g' /opt/honeycomb/config/honeycomb.json
193 # Disable automatic upgrades
194 if [[ $CLOUD_ENV != "rackspace" ]]
196 echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
197 sed -i 's/\(APT::Periodic::Unattended-Upgrade\) "1"/\1 "0"/' /etc/apt/apt.conf.d/20auto-upgrades
200 echo 'Execution of vG build script completed' > /opt/script_status.txt