3 # Copyright (c) 2017 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.
21 URL="https://nexus.fd.io/service/local/artifact/maven/content"
24 HC_GROUP="io.fd.hc2vpp"
25 NSH_GROUP="io.fd.nsh_sfc"
26 HC_ARTIFACTS="honeycomb"
27 NSH_ARTIFACTS="vpp-nsh-plugin"
29 if [ "${OS}" == "ubuntu1404" ]; then
30 OS="ubuntu.trusty.main"
33 VPP_ARTIFACTS="vpp vpp-lib vpp-plugins"
34 elif [ "${OS}" == "ubuntu1604" ]; then
35 OS="ubuntu.xenial.main"
38 VPP_ARTIFACTS="vpp vpp-lib vpp-plugins"
39 elif [ "${OS}" == "centos7" ]; then
43 VPP_ARTIFACTS="vpp vpp-lib vpp-plugins"
46 REPO="fd.io.${STREAM}.${OS}"
48 # download latest honeycomb and nsh packages
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
61 # determine VPP dependency
62 # use latest if honeycomb package does not depend on single VPP version, e.g. stable branches since HC2VPP-285
64 if [ "${OS}" == "centos7" ]; then
65 HC_VPP_VER=`rpm -qpR honeycomb*.rpm | grep -oP 'vpp = \K.+'`
66 if [ "${HC_VPP_VER}" != "" ]; then
67 VER=${HC_VPP_VER}.x86_64
70 HC_VPP_VER=`dpkg -I honeycomb*.deb | grep -oP 'vpp \(= \K[^\)]+'`
71 if [ "${HC_VPP_VER}" != "" ]; then
72 VER=${HC_VPP_VER}_amd64
76 # download VPP packages
77 for ART in ${VPP_ARTIFACTS}; do
78 for PAC in ${PACKAGE}; do
79 curl "${URL}?r=${REPO}&g=${GROUP}&a=${ART}&p=${PAC}&v=${VER}&c=${CLASS}" -O -J || exit
83 # verify downloaded package
84 if [ "${OS}" == "centos7" ]; then
90 for FILE in ${FILES}; do
91 echo " "${FILE} >> ${FILE}.md5
93 for MD5FILE in *.md5; do
94 md5sum -c ${MD5FILE} || exit