summaryrefslogtreecommitdiffstats
path: root/jjb/hc2vpp
diff options
context:
space:
mode:
authorselias <samelias@cisco.com>2017-10-27 14:11:26 +0200
committerSamuel Eliáš <samelias@cisco.com>2017-10-30 13:17:37 +0000
commite9345bdaa3e7f261b0cd7af8522d39bb9268bc87 (patch)
treecb338789dff8cbff9805b261ea5caf83ce23443b /jjb/hc2vpp
parent3711886f5d0162b440c211d9983da7d578fc5fe1 (diff)
CSIT-797 Add honeycomb parameter to hc2vpp-csit-verify job
Changes to Honeycomb and HC2VPP sometimes depend on each other and so must be tested together. Change-Id: Ia84e36071783931ae03db76c19507f5cf30e3115 Signed-off-by: selias <samelias@cisco.com>
Diffstat (limited to 'jjb/hc2vpp')
-rw-r--r--jjb/hc2vpp/include-raw-hc2vpp-csit-verify-prebuild.sh43
1 files changed, 37 insertions, 6 deletions
diff --git a/jjb/hc2vpp/include-raw-hc2vpp-csit-verify-prebuild.sh b/jjb/hc2vpp/include-raw-hc2vpp-csit-verify-prebuild.sh
index c08b8309d..cfde5eacb 100644
--- a/jjb/hc2vpp/include-raw-hc2vpp-csit-verify-prebuild.sh
+++ b/jjb/hc2vpp/include-raw-hc2vpp-csit-verify-prebuild.sh
@@ -1,11 +1,41 @@
#!/bin/bash
set -xeu -o pipefail
-current_dir=`pwd`
-cd ${WORKSPACE}
+# Parse optional arguments from gerrit comment trigger
+for i in ${GERRIT_EVENT_COMMENT_TEXT}; do
+ case ${i} in
+ *honeycomb=*)
+ hc_commit_id=`echo "${i}" | cut -d = -f2-`
+ ;;
+ *vpp=*)
+ vpp_commit_id=`echo "${i}" | cut -d = -f2-`
+ ;;
+ *nsh_sfc=*)
+ nsh_commit_id=`echo "${i}" | cut -d = -f2-`
+ ;;
+ *)
+ ;;
+ esac
+done
+
+# If HC variable is set, clone and build Honeycomb infra from the specified commit
+# Otherwise skip this step, hc2vpp will use Honeycomb snapshots from Nexus
+if [ -n "${hc_commit_id}" ]; then
+ git clone https://gerrit.fd.io/r/honeycomb
+ cd honeycomb
+ ref=`git ls-remote -q | grep ${hc_commit_id} | awk '{print $2}'`
+ git fetch origin ${ref} && git checkout FETCH_HEAD
+ mvn clean install -DskipTests -Dcheckstyle.skip -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r
+ if [ $? != 0 ]; then
+ echo "Honeycomb infra build failed."
+ exit 1
+ fi
+ cd ${WORKSPACE}
+fi
+
+# TODO: Add option to build custom VPP and NSH packages
# Get CSIT branch from which to test from
-# running build-root/scripts/csit-test-branch
if [ -f csit-test-branch ]; then
chmod +x csit-test-branch
CSIT_BRANCH=`./csit-test-branch`
@@ -13,21 +43,22 @@ else
CSIT_BRANCH='master'
fi
-# Clone csit and download VPP packages
+# Clone csit
git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH}
# If the git clone fails, complain clearly and exit
if [ $? != 0 ]; then
echo "Failed to run: git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH}"
- exit
+ exit 1
fi
cd csit
+# Download VPP packages
if [ ${STREAM} == 'master' ]; then
./resources/tools/scripts/download_hc_build_pkgs.sh ${STREAM} ${OS}
else
./resources/tools/scripts/download_hc_build_pkgs.sh 'stable.'${STREAM} ${OS}
fi
-cd ${current_dir}
+cd ${WORKSPACE}