X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fautorelease%2Fnotify-build-failure.sh;h=a5c5c82bbe10b2678f94d9b70747fe009793ffa1;hb=c63a769409561aaba26bd709cf1f1d7292d4fa09;hp=5128c97bbe3a68138838833f8432367a6ffe2203;hpb=0a3c84bce0b23dfa756cf4ebfa275eabc344b1b3;p=releng%2Fbuilder.git diff --git a/jjb/autorelease/notify-build-failure.sh b/jjb/autorelease/notify-build-failure.sh index 5128c97bb..a5c5c82bb 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. @@ -11,6 +11,8 @@ # This script parses the console log to discover which project has caused a # build failure and notify the project as appropriate. +echo "---> notify-build-failure.sh" + NEWLINE=$'\n' RELEASE_EMAIL="release@lists.opendaylight.org" ARCHIVES_DIR="$JENKINS_HOSTNAME/$JOB_NAME/$BUILD_NUMBER" @@ -36,9 +38,11 @@ REACTOR_INFO=$(awk '/Reactor Summary:/ { flag=1 } # check for project format if [[ ${REACTOR_INFO} =~ .*::*.*::*. ]]; then # extract project and artifactId from full format - ODL=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $1); print $1 }') - PROJECT_=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $2); print $2 }') - NAME=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $3); print $3 }') + # Ex: REACTOR_INFO="ODL::sfc::odl-sfc-pot-netconf-renderer 072 " is broken down into + # NAME="ODL", PROJECT_="sfc" and NAME="odl-sfc-pot-netconf-renderer" + ODL=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+[0-9]+[ \t]+$|[ \t]+$/, "", $1); print $1}') + PROJECT_=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+[0-9]+[ \t]+$|[ \t]+$/, "", $2); print $2}') + NAME=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+[0-9]+[ \t]+$|[ \t]+$/, "", $3); print $3}') else # set project from partial format ODL="" @@ -79,11 +83,11 @@ if [ ! -z "$ARTIFACT_ID" ]; then elif [ "${#grouplist[@]}" -gt 1 ]; then GROUPLIST="NOTE: The artifactId: $ARTIFACT_ID matches multiple groups: ${grouplist[*]}" else - echo "Failed to determine project.groupId using xpaths" + echo "Unable to determine project.groupId using xpaths" fi else - echo "Failed to determine ARTIFACT_ID" - exit 1 + echo "Unable to determine failed ARTIFACT_ID. Build likely successful or bug in this script." + exit 0 fi # Construct email subject & body