4 # Parse optional arguments from gerrit comment trigger
5 for i in ${GERRIT_EVENT_COMMENT_TEXT}; do
8 hc_commit_id=`echo "${i}" | cut -d = -f2-`
11 jvpp_commit_id=`echo "${i}" | cut -d = -f2-`
14 vpp_commit_id=`echo "${i}" | cut -d = -f2-`
17 nsh_commit_id=`echo "${i}" | cut -d = -f2-`
20 csit_commit_id=`echo "${i}" | cut -d = -f2-`
27 # If HC variable is set, clone and build Honeycomb infra from the specified commit
28 # Otherwise skip this step, hc2vpp will use Honeycomb snapshots from Nexus
29 if [[ -n "${hc_commit_id}" ]]; then
30 git clone https://gerrit.fd.io/r/honeycomb
32 ref=`git ls-remote -q | grep ${hc_commit_id} | awk '{print $2}'`
33 git fetch origin ${ref} && git checkout FETCH_HEAD
34 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}"
35 if [[ $? != 0 ]]; then
36 echo "Honeycomb infra build failed."
40 # Clean up when done. Leftover build files interfere with building hc2vpp.
44 # TODO: Add option to build custom VPP and NSH packages
46 # Get CSIT branch from which to test from
47 if [[ -f csit-test-branch ]]; then
48 chmod +x csit-test-branch
49 CSIT_BRANCH=`./csit-test-branch`
55 git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH}
57 # If the git clone fails, complain clearly and exit
58 if [[ $? != 0 ]]; then
59 echo "Failed to run: git clone https://gerrit.fd.io/r/csit --branch ${CSIT_BRANCH}"
65 # If CSIT commit ID is given, checkout the specified commit
66 if [[ -n "${csit_commit_id}" ]]; then
69 # e8f326efebb58e28dacb9ebb653baf95aad1448c refs/changes/08/11808/1
71 ref=`git ls-remote -q | grep ${csit_commit_id} | awk '{print $2}'`
72 git fetch origin ${ref} && git checkout FETCH_HEAD
75 # Download VPP packages
76 if [[ "1807 1810 1901" =~ .*$STREAM.* ]]; then
77 # add stable prefix for branches which have older version of package download script
78 # This can be removed when support for 1901 branch ends.
79 if [[ -n "${jvpp_commit_id}" ]]; then
80 echo "Error: Specifying jvpp custom commit is not supported for 1807,1810,1901 stable branches"
83 ./resources/tools/scripts/download_hc_build_pkgs.sh 'stable.'${STREAM} ${OS}
85 # master and 1904+ branches use new package-cloud download script
86 ./resources/tools/scripts/download_hc_build_pkgs.sh ${STREAM} ${OS} ${jvpp_commit_id}