aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools
diff options
context:
space:
mode:
authorMichal Cmarada <mcmarada@cisco.com>2019-03-07 11:31:15 +0100
committerPeter Mikus <pmikus@cisco.com>2019-03-11 12:48:24 +0000
commit6c295bd3d177d42343bfed4596655ce6604e0e55 (patch)
treeb3cfa80a15b73246a13c0fd6862f2a1bbf3ae264 /resources/tools
parent8683454ed3dcf5c713c99b8835b293fb3be53f84 (diff)
add support for using custom jvpp commit
Change-Id: I492541a0a0d6cdc08f03e4c47fc86f22716cf065 Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
Diffstat (limited to 'resources/tools')
-rwxr-xr-xresources/tools/scripts/download_hc_build_pkgs.sh63
1 files changed, 59 insertions, 4 deletions
diff --git a/resources/tools/scripts/download_hc_build_pkgs.sh b/resources/tools/scripts/download_hc_build_pkgs.sh
index 80e744e047..c534b65aa0 100755
--- a/resources/tools/scripts/download_hc_build_pkgs.sh
+++ b/resources/tools/scripts/download_hc_build_pkgs.sh
@@ -17,6 +17,7 @@ set -ex
STREAM=$1
OS=$2
+jvpp_commit_id=$3
# Figure out what system we are running on
if [[ -f /etc/os-release ]];then
@@ -33,9 +34,18 @@ echo DISTRIB_DESCRIPTION: ${PRETTY_NAME}
VERSION=`../vpp-version`
JVPP_VERSION=`../jvpp-version`
-VPP_DEB_NEW_ARTIFACTS="vpp libvppinfra vpp-plugin-core vpp-plugin-dpdk vpp-api-java"
-VPP_DEB_ARTIFACTS="vpp vpp-lib vpp-plugins vpp-api-java"
-VPP_RPM_ARTIFACTS="vpp vpp-lib vpp-plugins vpp-api-java"
+
+if [[ -n "${jvpp_commit_id}" ]]; then
+ # Skipping download of JVPP because it was built from source
+ VPP_DEB_NEW_ARTIFACTS="vpp libvppinfra vpp-plugin-core vpp-plugin-dpdk vpp-dev libvppinfra-dev"
+ VPP_DEB_ARTIFACTS="vpp vpp-lib vpp-plugins vpp-dev"
+ VPP_RPM_ARTIFACTS="vpp vpp-lib vpp-plugins vpp-devel"
+else
+ VPP_DEB_NEW_ARTIFACTS="vpp libvppinfra vpp-plugin-core vpp-plugin-dpdk vpp-api-java"
+ VPP_DEB_ARTIFACTS="vpp vpp-lib vpp-plugins vpp-api-java"
+ VPP_RPM_ARTIFACTS="vpp vpp-lib vpp-plugins vpp-api-java"
+fi
+
IGNORE_DEPS=""
# Check OS and stream to set correct packages
if [[ "$ID" == "centos" ]]; then
@@ -88,6 +98,51 @@ fi
# NSH_GROUP="io.fd.nsh_sfc"
# NSH_ARTIFACTS="vpp-nsh-plugin"
+# If JVPP variable is set, clone and build JVPP from the specified commit
+# Otherwise skip this step, hc2vpp will use JVPP snapshots from Nexus
+if [[ -n "${jvpp_commit_id}" ]]; then
+ # first we need to install vpp and deps to be able to build jvpp
+ if [[ "$ID" == "centos" ]]; then
+ sudo rpm -i vpp-*.rpm
+ else
+ if [[ "$VERSION_CODENAME" == "xenial" ]]; then
+ sudo dpkg --ignore-depends=libmbedcrypto0,libmbedtls10,libmbedx509-0 -i vpp_*.deb vpp-dev_*.deb vpp-plugin-core_*.deb libvppinfra_*.deb libvppinfra-dev_*.deb
+ elif [[ "$VERSION_CODENAME" == "bionic" ]]; then
+ sudo dpkg --ignore-depends=libmbedcrypto1,libmbedtls10,libmbedx509-0 -i vpp_*.deb vpp-dev_*.deb vpp-plugin-core_*.deb libvppinfra_*.deb libvppinfra-dev_*.deb
+ else
+ echo "Error: Unsupported UBUNTU version."
+ exit 1
+ fi
+ fi
+ # create new dir for custom jvpp build (jvpp directory already exists in hc2vpp, therefore using jvpp_src)
+ mkdir jvpp_src
+ cd jvpp_src
+ git clone https://gerrit.fd.io/r/jvpp
+ cd jvpp
+ ref=`git ls-remote -q | grep ${jvpp_commit_id} | awk '{print $2}'`
+ git fetch origin ${ref} && git checkout FETCH_HEAD
+ ./clean.sh
+ if [[ "$ID" == "centos" ]]; then
+ cmake3 .
+ else
+ cmake .
+ fi
+ make package
+ if [[ $? != 0 ]]; then
+ echo "JVPP build failed."
+ exit 1
+ fi
+ cp build-root/packages/vpp-api-java* ${WORKSPACE}/csit
+ cd ${WORKSPACE}/csit
+ # Clean up when done.
+ if [[ "$ID" == "centos" ]]; then
+ sudo yum remove "*vpp*"
+ else
+ sudo apt remove "*vpp*"
+ fi
+ rm -rf jvpp_src
+fi
+
# install vpp-api-java, this extracts jvpp .jar files into usr/share/java
if [[ "${OS}" == "centos7" ]]; then
sudo rpm --nodeps --install vpp-api-java*
@@ -107,7 +162,7 @@ for item in jvpp*.jar; do
# Version = 19.04 or 19.04-SNAPSHOT
basefile=$(basename -s .jar "$item")
artifactId=$(echo "$basefile" | cut -d '-' -f 1-2)
- 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
+ mvn install:install-file -Dfile=${item} -DgroupId=io.fd.jvpp -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
done
# vpp-api-package is no longer necessary, breaks the installation of other packages that follow in next steps