X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fautorelease%2Fnotify-build-failure.sh;h=6eafef7b4383d1bf4687aec1876b03cc9d62ef4a;hb=232a18be06afa78543dd8e833559e8088fe0baed;hp=7eefa4043a0322fca793e253466cd4796ea4fe88;hpb=d41a197cf795fc3dfc8e4583439c740c64949b72;p=releng%2Fbuilder.git diff --git a/jjb/autorelease/notify-build-failure.sh b/jjb/autorelease/notify-build-failure.sh index 7eefa4043..6eafef7b4 100644 --- a/jjb/autorelease/notify-build-failure.sh +++ b/jjb/autorelease/notify-build-failure.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -60,7 +60,7 @@ ARTIFACT_ID=$(awk -F: '/\[ERROR\].*mvn -rf :/ { print $2}' $CONSOLE_LOG) # project.groupId is not set but IS inherited from project.parent.groupId # else # exclude project mailing list -if [ ! -z "$ARTIFACT_ID" ]; then +if [ -n "$ARTIFACT_ID" ]; then grouplist=() while IFS="" read -r p; do GROUP=$(xmlstarlet sel\ @@ -72,7 +72,7 @@ if [ ! -z "$ARTIFACT_ID" ]; then -v "/x:project/x:parent/x:groupId"\ --else -o ""\ "$p" 2>/dev/null) - if [ ! -z "${GROUP}" ]; then + if [ -n "${GROUP}" ]; then # shellcheck disable=SC2207 grouplist+=($(echo "${GROUP}" | awk -F'.' '{ print $3 }')) fi @@ -122,7 +122,8 @@ ODL releng/autorelease team BUILD_STATUS=$(awk '/\[INFO\] Remote staging finished/{flag=1;next}/Total time:/{flag=0}flag' $CONSOLE_LOG \ | grep '\] BUILD' | awk '{print $3}') -if ([ ! -z "${NAME}" ] || [ ! -z "${ARTIFACT_ID}" ]) && [[ "${BUILD_STATUS}" != "SUCCESS" ]]; then +# shellcheck disable=SC2235 +if ([ -n "${NAME}" ] || [ -n "${ARTIFACT_ID}" ]) && [[ "${BUILD_STATUS}" != "SUCCESS" ]]; then # project search pattern should handle both scenarios # 1. Full format: ODL :: $PROJECT :: $ARTIFACT_ID # 2. Partial format: Building $ARTIFACT_ID