- shell: |
./scripts/fix-relativepaths.sh
-- builder:
+- publisher:
# include-raw-autorelease-notify-build-failure.sh searches console log for
# failures and emails the status to the release mailing list.
name: opendaylight-infra-notify-status
- builders:
- - shell:
- !include-raw: include-raw-autorelease-notify-build-failure.sh
+ publishers:
+ - postbuildscript:
+ builders:
+ - shell:
+ !include-raw: include-raw-autorelease-notify-build-failure.sh
+ script-only-if-succeeded: False
+ script-only-if-failed: True
global-settings: 'odl-global-settings'
- autorelease-maven-sources-post-process
- autorelease-sys-stats
- - opendaylight-infra-notify-status
- shell: |
mkdir -p archives/
cp *.log *.prop $_
publishers:
+ - opendaylight-infra-notify-status
- archive:
# Need to archive dependencies.log in Jenkins to provide a simple
# way for downstream jobs to pull the latest version of this file
- opendaylight-infra-shiplogs:
maven-version: 'mvn33'
+
- job-template:
name: 'autorelease-project-report-{stream}'
# get console logs
wget -O $CONSOLE_LOG ${BUILD_URL}consoleText
-# get the failed project or artifactid
-TEMP=`awk '/Reactor Summary:/{flag=1;next} \
- /Final Memory:/{flag=0}flag' $CONSOLE_LOG \
- | grep '. FAILURE \[' | awk -F'[].]' '{gsub(/ /, "", $2); print $2 }'`
+# extract the failing project or artifactid
+REACTOR_INFO=`awk '/Reactor Summary:/ { flag=1 }
+ flag {
+ if ( sub(/^\[(INFO)\]/,"") && sub(/FAILURE \[.*/,"") ) {
+ gsub(/[[:space:]]*::[[:space:]]*/,"::")
+ gsub(/^[[:space:]]+|[[:space:]]+$|[.]/,"")
+ print
+ }
+ }
+ /Final Memory:/ { flag=0 }' $CONSOLE_LOG`
# check for project format
-if [[ ${TEMP} =~ .*::*.*::*. ]]; then
+if [[ ${REACTOR_INFO} =~ .*::*.*::*. ]]; then
# extract project and artifactid from full format
- PROJECT=`echo ${TEMP} | awk -F'::' '{ print $2 }'`
- ARTIFACTID=`echo ${TEMP} |awk -F'::' '{ print $3 }'`
+ ODL=`echo ${REACTOR_INFO} | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $1); print $1 }'`
+ PROJECT=`echo ${REACTOR_INFO} | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $2); print $2 }'`
+ ARTIFACTID=`echo ${REACTOR_INFO} | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $3); print $3 }'`
else
- # set ARTIFACTID to partial format
- ARTIFACTID=${TEMP}
+ # set ARTIFACTID to partial format
+ ODL=""
+ PROJECT=""
+ ARTIFACTID=`echo ${REACTOR_INFO} | awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }'`
fi
# check if remote staging is complete successfully
# project search pattern should handle both scenarios
# 1. Full format: ODL :: $PROJECT :: $ARTIFACTID
# 2. Partial format: Building $ARTIFACTID
- awk "/\[INFO\] Building ${ARTIFACTID} / || /ODL :: ${PROJECT} :: ${ARTIFACTID} /{flag=1;next} \
- /Reactor Summary:/{flag=0}flag" $CONSOLE_LOG > /tmp/error_msg
+ sed -e "/\[INFO\] Building \(${ARTIFACTID} \|${ODL} :: ${PROJECT} :: ${ARTIFACTID} \)/,/Reactor Summary:/!d;//d" \
+ $CONSOLE_LOG > /tmp/error_msg
if [ -z "${PROJECT}" ]; then
PROJECT=${ARTIFACTID}
SUBJECT="[release] Autorelease ${STREAM} build failure: ${PROJECT}"
- echo "${BODY}" | mail -A /tmp/error_msg -s "${SUBJECT}" "${RELEASE_EMAIL}"
+ echo "${BODY}" | mail -a /tmp/error_msg -s "${SUBJECT}" "${RELEASE_EMAIL}"
fi
rm $CONSOLE_LOG