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
21 # Download the latest VPP .deb packages, their matching JVPP .jar and VPP plugin .deb packages
22 URL="https://nexus.fd.io/service/local/artifact/maven/content"
24 REPO='fd.io.master.ubuntu.trusty.main'
25 JVPP_REPO='fd.io.snapshot'
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 JVPP_ARTIFACTS="jvpp-core jvpp-registry jvpp-acl jvpp-snat jvpp-ioam-pot jvpp-ioam-trace"
31 HC_ARTIFACTS="honeycomb"
32 NSH_ARTIFACTS="vpp-nsh-plugin"
34 JVPP_PACKAGE="jar jar.md5"
37 for ART in ${VPP_ARTIFACTS}; do
38 for PAC in $PACKAGE; do
39 curl "${URL}?r=${REPO}&g=${VPP_GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
43 for ART in ${JVPP_ARTIFACTS}; do
44 for PAC in $JVPP_PACKAGE; do
45 curl "${URL}?r=${JVPP_REPO}&g=${VPP_GROUP}&a=${ART}&p=${PAC}&v=${VER}" -O -J || exit
49 for ART in ${HC_ARTIFACTS}; do
50 for PAC in $PACKAGE; do
51 curl "${URL}?r=${REPO}&g=${HC_GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
55 for ART in ${NSH_ARTIFACTS}; do
56 for PAC in $PACKAGE; do
57 curl "${URL}?r=${REPO}&g=${NSH_GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
62 echo " "${FILE} >> ${FILE}.md5
66 echo " "${FILE} >> ${FILE}.md5
69 for MD5FILE in *.md5; do
70 md5sum -c ${MD5FILE} || exit
73 # Install JVPP to maven local repo, to be used in HC2VPP build
74 JVPP_JARS=$(find . -type f -iname '*.jar')
75 for item in jvpp*.jar; do
76 # Example filename: jvpp-registry-17.01-20161206.125556-1.jar
77 # ArtifactId = jvpp-registry
79 basefile=$(basename -s .jar "$item")
80 artifactId=$(echo "$basefile" | cut -d '-' -f 1-2)
81 version=$(echo "$basefile" | cut -d '-' -f 3)
82 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