From: Tim Johnson Date: Thu, 12 Dec 2019 04:00:14 +0000 (-0800) Subject: Remove Invalid function call from Bash library X-Git-Tag: v0.49.0~7 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F62611%2F2;p=releng%2Fglobal-jjb.git Remove Invalid function call from Bash library The function lf-echo-error() was renamed lf-echo-stderr(). Rename the bad references. Some cleanup of log messages. Issue: RELENG-2581 Change-Id: Ieaccc6049e3a7e70c3bb973f993849bc2a50579c Signed-off-by: Tim Johnson --- diff --git a/jenkins-init-scripts/lf-env.sh b/jenkins-init-scripts/lf-env.sh index 37aaf7e1..f0341f34 100644 --- a/jenkins-init-scripts/lf-env.sh +++ b/jenkins-init-scripts/lf-env.sh @@ -218,10 +218,12 @@ function lf-git-validate-jira-urls() base_url=$(echo "$JIRA_URL" | awk -F'/' '{print $3}') jira_link=$(git rev-list --format=%B --max-count=1 HEAD | grep -io "http[s]*://$base_url/" || true) if [[ -n $jira_link ]]; then - lf-echo-error 'Remove JIRA URLs from commit message' - lf-echo-error 'Add jira references as: Issue: -, instead of URLs' + lf-echo-stderr "${FUNCNAME[0]}(): ERROR: JIRA URL found in commit message" + lf-echo-stderr 'Add jira references as: Issue: -, instead of URLs' return 1 fi + else + echo "${FUNCNAME[0]}(): WARNING: JIRA_URL not set, continuing anyway" fi return 0 } @@ -250,12 +252,12 @@ function lf-git-validate-jira-urls() function lf-jjb-check-ascii() { if [[ ! -d "jjb" ]]; then - lf-echo-error "${FUNCNAME[0]}(): ERROR: missing jjb directory" - lf-echo-error "This function can only be run from top of global-jjb directory" + lf-echo-stderr "${FUNCNAME[0]}(): ERROR: missing jjb directory" + lf-echo-stderr "This function can only be run from top of global-jjb directory" return 1 fi if LC_ALL=C grep -I -r '[^[:print:][:space:]]' jjb/; then - lf-echo-error "${FUNCNAME[0]}(): ERROR: Found YAML files containing non-printable characters." + lf-echo-stderr "${FUNCNAME[0]}(): ERROR: Found YAML files containing non-printable characters." return 1 fi echo "${FUNCNAME[0]}(): INFO: All JJB YAML files contain only printable ASCII characters"