Merge "Configure VPP Jenkins view"
[ci-management.git] / jjb / hc2vpp / include-raw-hc2vpp-csit-verify-prebuild.sh
index cfde5ea..ac33627 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-set -xeu -o pipefail
+set -xe -o pipefail
 
 # Parse optional arguments from gerrit comment trigger
 for i in ${GERRIT_EVENT_COMMENT_TEXT}; do
@@ -13,6 +13,9 @@ for i in ${GERRIT_EVENT_COMMENT_TEXT}; do
         *nsh_sfc=*)
             nsh_commit_id=`echo "${i}" | cut -d = -f2-`
         ;;
+        *csit=*)
+            csit_commit_id=`echo "${i}" | cut -d = -f2-`
+        ;;
         *)
         ;;
     esac
@@ -25,12 +28,14 @@ if [ -n "${hc_commit_id}" ]; then
     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
+    mvn clean install -DskipTests -Dcheckstyle.skip -Dmaven.repo.local=/tmp/r -Dorg.ops4j.pax.url.mvn.localRepository=/tmp/r -gs "${GLOBAL_SETTINGS_FILE}" -s "${SETTINGS_FILE}"
     if [ $? != 0 ]; then
         echo "Honeycomb infra build failed."
         exit 1
     fi
     cd ${WORKSPACE}
+    # Clean up when done. Leftover build files interfere with building hc2vpp.
+    rm -rf honeycomb
 fi
 
 # TODO: Add option to build custom VPP and NSH packages
@@ -54,6 +59,16 @@ fi
 
 cd csit
 
+# If CSIT commit ID is given, checkout the specified commit
+if [ -n "${csit_commit_id}" ]; then
+    # Example:
+    # ...
+    # e8f326efebb58e28dacb9ebb653baf95aad1448c refs/changes/08/11808/1
+    # ...
+    ref=`git ls-remote -q | grep ${csit_commit_id} | awk '{print $2}'`
+    git fetch origin ${ref} && git checkout FETCH_HEAD
+fi
+
 # Download VPP packages
 if [ ${STREAM} == 'master' ]; then
     ./resources/tools/scripts/download_hc_build_pkgs.sh ${STREAM} ${OS}