3 # Copyright (c) 2016 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 trap 'rm -f *.deb.md5; exit' EXIT
19 trap 'rm -f *.deb.md5;rm -f *.deb; exit' ERR
22 # Download the latest VPP .deb packages, their matching JVPP .jar and VPP plugin .deb packages
23 URL="https://nexus.fd.io/service/local/artifact/maven/content"
25 REPO="fd.io.${STREAM}.ubuntu.trusty.main"
27 HC_GROUP="io.fd.hc2vpp"
28 NSH_GROUP="io.fd.nsh_sfc"
29 VPP_ARTIFACTS="vpp vpp-dbg vpp-dev vpp-dpdk-dev vpp-dpdk-dkms vpp-lib vpp-plugins"
30 HC_ARTIFACTS="honeycomb"
31 NSH_ARTIFACTS="vpp-nsh-plugin"
35 if [ ${STREAM} == 'stable.1701' ]; then
36 JVPP_VER="17.01-SNAPSHOT"
37 JVPP_REPO="fd.io.snapshot"
38 JVPP_ARTIFACTS="jvpp-core jvpp-registry"
39 JVPP_PACKAGE="jar jar.md5"
40 for ART in ${JVPP_ARTIFACTS}; do
41 for PAC in $JVPP_PACKAGE; do
42 curl "${URL}?r=${JVPP_REPO}&g=${VPP_GROUP}&a=${ART}&p=${PAC}&v=${JVPP_VER}" -O -J || exit
45 # Install JVPP to maven local repo, to be used in HC2VPP build
46 JVPP_JARS=$(find . -type f -iname '*.jar')
47 for item in jvpp*.jar; do
48 # Example filename: jvpp-registry-17.01-20161206.125556-1.jar
49 # ArtifactId = jvpp-registry
51 basefile=$(basename -s .jar "$item")
52 artifactId=$(echo "$basefile" | cut -d '-' -f 1-2)
53 version=$(echo "$basefile" | cut -d '-' -f 3)
54 mvn install:install-file -Dfile=${item} -DgroupId=io.fd.vpp -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
57 # After 17.01 JVPP jars are installed from "vpp-api-java" package
58 VPP_ARTIFACTS+=' vpp-api-java'
61 for ART in ${VPP_ARTIFACTS}; do
62 for PAC in $PACKAGE; do
63 curl "${URL}?r=${REPO}&g=${VPP_GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
67 for ART in ${HC_ARTIFACTS}; do
68 for PAC in $PACKAGE; do
69 curl "${URL}?r=${REPO}&g=${HC_GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
73 for ART in ${NSH_ARTIFACTS}; do
74 for PAC in $PACKAGE; do
75 curl "${URL}?r=${REPO}&g=${NSH_GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
80 echo " "${FILE} >> ${FILE}.md5
84 echo " "${FILE} >> ${FILE}.md5
87 for MD5FILE in *.md5; do
88 md5sum -c ${MD5FILE} || exit