From 7cb306f748cb59bba53c1b07619383010e498648 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 12 Jan 2023 08:48:47 +0000 Subject: feat: set STREAM parameters in functional tests Ticket: HICN-822 Change-Id: I0b05a3d4b01fe2ab35682eb7d70fa0f0bdf05176 Signed-off-by: Mauro Sardara --- scripts/functions.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/functions.sh b/scripts/functions.sh index 9ff252416..66235cf5f 100644 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -86,14 +86,17 @@ function setup_extras() { function download_artifacts() { if [[ -n ${GERRIT_HOST:-} ]] && [[ -n ${GERRIT_CHANGE_NUMBER:-} ]] && - [[ -n ${GERRIT_PATCHSET_NUMBER:-} ]]; then + [[ -n ${GERRIT_PATCHSET_NUMBER:-} ]] && + [[ -n ${GERRIT_BRANCH:-} ]]; then + + PC_STREAM="${GERRIT_BRANCH#'stable/'}" # Retrieve the Jenkins URL of the build relative to this PATCHSET JENKINS_URLS=$( curl -s "https://${GERRIT_HOST}/r/changes/${GERRIT_CHANGE_NUMBER}/detail" | tail -n +2 | jq '.messages[].message?' | - grep -E "Patch Set ${GERRIT_PATCHSET_NUMBER}:.*hicn-verify-build.*build_success-hicn-ubuntu2004-$(uname -m)" | - grep -Eo "https?://jenkins.fd.io/job/hicn-verify-build-hicn-ubuntu2004-$(uname -m)[^ ]+" + grep -E "Patch Set ${GERRIT_PATCHSET_NUMBER}:.*hicn-verify-build.*build_success-${PC_STREAM}-ubuntu2004-$(uname -m)" | + grep -Eo "https?://jenkins.fd.io/job/hicn-verify-build-${PC_STREAM}-ubuntu2004-$(uname -m)[^ ]+" ) # Transform string to array and get last -- cgit 1.2.3-korg