Merge "Remove depricated flags and add fix missing"
authorThanh Ha <thanh.ha@linuxfoundation.org>
Mon, 27 Mar 2017 15:32:50 +0000 (15:32 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 27 Mar 2017 15:32:50 +0000 (15:32 +0000)
jjb/autorelease/include-raw-autorelease-notify-build-failure.sh
jjb/include-raw-deploy-archives.sh
jjb/releng-jobs.yaml
packer/provision/java-builder.sh

index be274985e8564df3ecd04c7bd3a91b35e945ad11..645b70456308dd4adb9977dd52598c2c9ed75352 100644 (file)
@@ -17,7 +17,9 @@ STREAM=${JOB_NAME#*-*e-}
 # get console logs
 wget -O "$CONSOLE_LOG" "${BUILD_URL}consoleText"
 
-# extract the failing project or artifactid
+# TODO: This section is still required since some of the projects use
+# description. Remove this section when the reactor info is more consistant.
+# extract failing project from reactor information
 REACTOR_INFO=$(awk '/Reactor Summary:/ { flag=1 }
           flag {
              if ( sub(/^\[(INFO)\]/,"") && sub(/FAILURE \[.*/,"") ) {
@@ -30,25 +32,59 @@ REACTOR_INFO=$(awk '/Reactor Summary:/ { flag=1 }
 
 # check for project format
 if [[ ${REACTOR_INFO} =~ .*::*.*::*. ]]; then
-    # extract project and artifactid from full format
+    # 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 }')
-    ARTIFACTID=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $3); print $3 }')
+    PROJECT_=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $2); print $2 }')
+    NAME=$(echo "${REACTOR_INFO}" | awk -F'::' '{ gsub(/^[ \t]+|[ \t]+$/, "", $3); print $3 }')
 else
     # set ARTIFACTID to partial format
     ODL=""
-    PROJECT=""
-    ARTIFACTID=$(echo "${REACTOR_INFO}" | awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }')
+    PROJECT_=""
+    NAME=$(echo "${REACTOR_INFO}" | awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }')
+fi
+
+
+# determine ARTIFACT_ID for project mailing list
+ARTIFACT_ID=$(awk -F: '/\[ERROR\].*mvn <goals> -rf :/ { print $2}' $CONSOLE_LOG)
+
+# determine project mailing list using xpaths
+# if project.groupId:
+#     project.groupId is set and is not inherited
+# else if project.parent.groupId:
+#     project.groupId is not set but IS inherited from project.parent.groupId
+# else
+#     exclude project mailing list
+grouplist=()
+while IFS="" read -r p; do
+    GROUP=$(xmlstarlet sel\
+          -N "x=http://maven.apache.org/POM/4.0.0"\
+          -t -m "/x:project[x:artifactId='$ARTIFACT_ID']"\
+          --if "/x:project/x:groupId"\
+          -v "/x:project/x:groupId"\
+          --elif "/x:project/x:parent/x:groupId"\
+          -v "/x:project/x:parent/x:groupId"\
+          --else -o ""\
+          "$p" 2>/dev/null)
+    if [ ! -z "${GROUP}" ]; then
+        grouplist+=($(echo "${GROUP}" | awk -F'.' '{ print $3 }'))
+    fi
+done < <(find . -name "pom.xml")
+
+if [ "${#grouplist[@]}" -eq 1 ]; then
+    PROJECT="${grouplist[0]}"
+else
+    GROUPLIST="NOTE: The artifactId: $ARTIFACT_ID matches multiple groups: ${grouplist[*]}"
 fi
 
 # Construct email subject & body
 PROJECT_STRING=${PROJECT:+" from $PROJECT"}
-SUBJECT="[release] Autorelease $STREAM failed to build $ARTIFACTID$PROJECT_STRING"
+SUBJECT="[release] Autorelease $STREAM failed to build $ARTIFACT_ID$PROJECT_STRING"
 BODY="Attention ${PROJECT:-"OpenDaylight"}-devs,
 
-Autorelease $STREAM failed to build $ARTIFACTID$PROJECT_STRING in build
+Autorelease $STREAM failed to build $ARTIFACT_ID$PROJECT_STRING in build
 $BUILD_NUMBER. Attached is a snippet of the error message related to the
 failure that we were able to automatically parse as well as console logs.
+${PROJECT:+"$GROUPLIST"}
 
 Console Logs:
 https://logs.opendaylight.org/$SILO/$ARCHIVES_DIR
@@ -66,11 +102,11 @@ 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 "${ARTIFACTID}" ] && [[ "${BUILD_STATUS}" != "SUCCESS" ]]; then
+if ([ ! -z "${NAME}" ] || [ ! -z "${ARTIFACT_ID}" ]) && [[ "${BUILD_STATUS}" != "SUCCESS" ]]; then
     # project search pattern should handle both scenarios
-    # 1. Full format:    ODL :: $PROJECT :: $ARTIFACTID
-    # 2. Partial format: Building $ARTIFACTID
-    sed -e "/\[INFO\] Building \(${ARTIFACTID} \|${ODL} :: ${PROJECT} :: ${ARTIFACTID} \)/,/Reactor Summary:/!d;//d" \
+    # 1. Full format:    ODL :: $PROJECT :: $ARTIFACT_ID
+    # 2. Partial format: Building $ARTIFACT_ID
+    sed -e "/\[INFO\] Building \(${NAME} \|${ARTIFACT_ID} \|${ODL} :: ${PROJECT_} :: ${NAME} \)/,/Reactor Summary:/!d;//d" \
           $CONSOLE_LOG > /tmp/error.txt
 
     if [ -n "${PROJECT}" ]; then
index 56f0908b2c744331c92435fc50b11ebb0d52682d..81bc096b12541fb1140fd838a65ac82b0121f5c0 100644 (file)
@@ -119,7 +119,7 @@ find "$ARCHIVES_DIR" -type f -print0 \
                 | cut -d: -f1 \
                 | xargs -d'\n' -r gzip
 # Compress Java heap dumps using xz
-find "$ARCHIVES_DIR" -type -f -name \*.hprof -print0 | xargs -0 xz
+find "$ARCHIVES_DIR" -type f -name \*.hprof -print0 | xargs -0 xz
 
 zip -r archives.zip "$JENKINS_HOSTNAME/" > "$ARCHIVES_DIR/_archives-zip.log"
 du -sh archives.zip
index 0338f7871832a909d1fc4263215d00ec6fdfad87..25eb92acdd2a472f0acb72832d81f2dfcd2fec9a 100644 (file)
           virtualenv $WORKSPACE/venv
           source $WORKSPACE/venv/bin/activate
           pip install --upgrade pip
-          pip freeze
           pip install jenkins-job-builder
+          pip freeze
           jenkins-jobs -l DEBUG test --recursive -o archives/job_output jjb/
           gzip archives/job_output/*
       - releng-check-unicode
           virtualenv $WORKSPACE/venv
           source $WORKSPACE/venv/bin/activate
           pip install --upgrade pip
-          pip freeze
           pip install jenkins-job-builder
+          pip freeze
           jenkins-jobs --version
           jenkins-jobs update --recursive --delete-old --workers 4 jjb/
 
           virtualenv $WORKSPACE/venv
           source $WORKSPACE/venv/bin/activate
           pip install --upgrade pip
-          pip freeze
           pip install jenkins-job-builder
+          pip freeze
           jenkins-jobs --flush-cache update --recursive --workers 4 jjb/
 
     publishers:
index 11f6bb08d017141d64a3ff279106a104df262cb9..9f3da56efa2ac25790cebdced4fbbd79bb52fdbc 100644 (file)
@@ -10,7 +10,7 @@ set -xeu -o pipefail
 yum install -y @development perl-{Digest-SHA,ExtUtils-MakeMaker} \
     ant {boost,gtest,json-c,libcurl,libxml2,libvirt,openssl}-devel \
     {readline,unixODBC}-devel yum-utils fedora-packager \
-    libxslt-devel crudini npm
+    libxslt-devel crudini
 
 # Install python3 and dependencies, needed for Coala linting at least
 yum install -y python34
@@ -73,5 +73,3 @@ unzip packer_0.12.2_linux_amd64.zip -d /usr/local/bin/
 # rename packer to avoid conflict with binary in cracklib
 mv /usr/local/bin/packer /usr/local/bin/packer.io
 
-# Needed for Coala linting, Markdown and Dockerfile bears in particular
-npm install remark-cli dockerfile_lint