Repository: hbase
Updated Branches:
  refs/heads/HBASE-20364 [created] da8ede838


HBASE-20364 ensure jira comment from nightly reflects results of run comment 
comes from.

* in a post-step, build status can either be "null" or "SUCCESS" to indicate 
success.
* before we do an scm checkout for stages that post to the comment, set a 
default "we failed ¯\_(ツ)_/¯" comment.


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7d04d374
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7d04d374
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7d04d374

Branch: refs/heads/HBASE-20364
Commit: 7d04d3740d842a12ddd275f14f8305ac3e6b800b
Parents: d59a6c8
Author: Sean Busbey <bus...@apache.org>
Authored: Thu Apr 12 23:38:27 2018 -0500
Committer: Sean Busbey <bus...@apache.org>
Committed: Thu Apr 12 23:38:35 2018 -0500

----------------------------------------------------------------------
 dev-support/Jenkinsfile | 55 ++++++++++++++++++++++++++++++--------------
 1 file changed, 38 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/7d04d374/dev-support/Jenkinsfile
----------------------------------------------------------------------
diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile
index 3f3066b..cab5027 100644
--- a/dev-support/Jenkinsfile
+++ b/dev-support/Jenkinsfile
@@ -141,25 +141,30 @@ curl -L  -o personality.sh "${env.PROJECT_PERSONALITY}"
             OUTPUT_DIR = "${env.WORKSPACE}/${env.OUTPUT_DIR_RELATIVE_GENERAL}"
           }
           steps {
+            // Must do prior to anything else, since if one of them timesout 
we'll stash the commentfile
+            sh '''#!/usr/bin/env bash
+              set -e
+              rm -rf "${OUTPUT_DIR}" && mkdir "${OUTPUT_DIR}"
+              echo '(x) {color:red}-1 general checks{color}' 
>"${OUTPUT_DIR}/commentfile"
+              echo "-- Something went wrong running this stage, please [check 
relevant console output|${BUILD_URL}/console]." >> "${OUTPUT_DIR}/commentfile"
+'''
             unstash 'yetus'
             dir('component') {
               checkout scm
             }
             sh '''#!/usr/bin/env bash
               set -e
-              rm -rf "${OUTPUT_DIR}" && mkdir "${OUTPUT_DIR}"
               rm -rf "${OUTPUT_DIR}/machine" && mkdir "${OUTPUT_DIR}/machine"
               "${BASEDIR}/dev-support/gather_machine_environment.sh" 
"${OUTPUT_DIR_RELATIVE}/machine"
 '''
             // TODO roll this into the hbase_nightly_yetus script
             sh '''#!/usr/bin/env bash
               set -e
-              rm -rf "${OUTPUT_DIR}/commentfile}"
               declare -i status=0
               if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
-                echo '(/) {color:green}+1 general checks{color}' >> 
"${OUTPUT_DIR}/commentfile"
+                echo '(/) {color:green}+1 general checks{color}' > 
"${OUTPUT_DIR}/commentfile"
               else
-                echo '(x) {color:red}-1 general checks{color}' >> 
"${OUTPUT_DIR}/commentfile"
+                echo '(x) {color:red}-1 general checks{color}' > 
"${OUTPUT_DIR}/commentfile"
                 status=1
               fi
               echo "-- For more information [see general 
report|${BUILD_URL}/General_Nightly_Build_Report/]" >> 
"${OUTPUT_DIR}/commentfile"
@@ -201,24 +206,29 @@ curl -L  -o personality.sh "${env.PROJECT_PERSONALITY}"
             // On branches where we do jdk7 checks, jdk7 will be JAVA_HOME 
already.
           }
           steps {
+            // Must do prior to anything else, since if one of them timesout 
we'll stash the commentfile
+            sh '''#!/usr/bin/env bash
+              set -e
+              rm -rf "${OUTPUT_DIR}" && mkdir "${OUTPUT_DIR}"
+              echo '(x) {color:red}-1 jdk7 checks{color}' 
>"${OUTPUT_DIR}/commentfile"
+              echo "-- Something went wrong running this stage, please [check 
relevant console output|${BUILD_URL}/console]." >> "${OUTPUT_DIR}/commentfile"
+'''
             unstash 'yetus'
             dir('component') {
               checkout scm
             }
             sh '''#!/usr/bin/env bash
               set -e
-              rm -rf "${OUTPUT_DIR}" && mkdir "${OUTPUT_DIR}"
               rm -rf "${OUTPUT_DIR}/machine" && mkdir "${OUTPUT_DIR}/machine"
               "${BASEDIR}/dev-support/gather_machine_environment.sh" 
"${OUTPUT_DIR_RELATIVE}/machine"
 '''
             sh '''#!/usr/bin/env bash
               set -e
-              rm -rf "${OUTPUT_DIR}/commentfile}"
               declare -i status=0
               if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
-                echo '(/) {color:green}+1 jdk7 checks{color}' >> 
"${OUTPUT_DIR}/commentfile"
+                echo '(/) {color:green}+1 jdk7 checks{color}' > 
"${OUTPUT_DIR}/commentfile"
               else
-                echo '(x) {color:red}-1 jdk7 checks{color}' >> 
"${OUTPUT_DIR}/commentfile"
+                echo '(x) {color:red}-1 jdk7 checks{color}' > 
"${OUTPUT_DIR}/commentfile"
                 status=1
               fi
               echo "-- For more information [see jdk7 
report|${BUILD_URL}/JDK7_Nightly_Build_Report/]" >> "${OUTPUT_DIR}/commentfile"
@@ -274,24 +284,29 @@ curl -L  -o personality.sh "${env.PROJECT_PERSONALITY}"
             SET_JAVA_HOME = '/usr/lib/jvm/java-8-openjdk-amd64'
           }
           steps {
+            // Must do prior to anything else, since if one of them timesout 
we'll stash the commentfile
+            sh '''#!/usr/bin/env bash
+              set -e
+              rm -rf "${OUTPUT_DIR}" && mkdir "${OUTPUT_DIR}"
+              echo '(x) {color:red}-1 jdk8 hadoop2 checks{color}' 
>"${OUTPUT_DIR}/commentfile"
+              echo "-- Something went wrong running this stage, please [check 
relevant console output|${BUILD_URL}/console]." >> "${OUTPUT_DIR}/commentfile"
+'''
             unstash 'yetus'
             dir('component') {
               checkout scm
             }
             sh '''#!/usr/bin/env bash
               set -e
-              rm -rf "${OUTPUT_DIR}" && mkdir "${OUTPUT_DIR}"
               rm -rf "${OUTPUT_DIR}/machine" && mkdir "${OUTPUT_DIR}/machine"
               "${BASEDIR}/dev-support/gather_machine_environment.sh" 
"${OUTPUT_DIR_RELATIVE}/machine"
 '''
             sh '''#!/usr/bin/env bash
               set -e
-              rm -rf "${OUTPUT_DIR}/commentfile}"
               declare -i status=0
               if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
-                echo '(/) {color:green}+1 jdk8 hadoop2 checks{color}' >> 
"${OUTPUT_DIR}/commentfile"
+                echo '(/) {color:green}+1 jdk8 hadoop2 checks{color}' > 
"${OUTPUT_DIR}/commentfile"
               else
-                echo '(x) {color:red}-1 jdk8 hadoop2 checks{color}' >> 
"${OUTPUT_DIR}/commentfile"
+                echo '(x) {color:red}-1 jdk8 hadoop2 checks{color}' > 
"${OUTPUT_DIR}/commentfile"
                 status=1
               fi
               echo "-- For more information [see jdk8 (hadoop2) 
report|${BUILD_URL}/JDK8_Nightly_Build_Report_(Hadoop2)/]" >> 
"${OUTPUT_DIR}/commentfile"
@@ -354,24 +369,29 @@ curl -L  -o personality.sh "${env.PROJECT_PERSONALITY}"
             HADOOP_PROFILE = '3.0'
           }
           steps {
+            // Must do prior to anything else, since if one of them timesout 
we'll stash the commentfile
+            sh '''#!/usr/bin/env bash
+              set -e
+              rm -rf "${OUTPUT_DIR}" && mkdir "${OUTPUT_DIR}"
+              echo '(x) {color:red}-1 jdk8 hadoop3 checks{color}' 
>"${OUTPUT_DIR}/commentfile"
+              echo "-- Something went wrong running this stage, please [check 
relevant console output|${BUILD_URL}/console]." >> "${OUTPUT_DIR}/commentfile"
+'''
             unstash 'yetus'
             dir('component') {
               checkout scm
             }
             sh '''#!/usr/bin/env bash
               set -e
-              rm -rf "${OUTPUT_DIR}" && mkdir "${OUTPUT_DIR}"
               rm -rf "${OUTPUT_DIR}/machine" && mkdir "${OUTPUT_DIR}/machine"
               "${BASEDIR}/dev-support/gather_machine_environment.sh" 
"${OUTPUT_DIR_RELATIVE}/machine"
 '''
             sh '''#!/usr/bin/env bash
               set -e
-              rm -rf "${OUTPUT_DIR}/commentfile}"
               declare -i status=0
               if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
-                echo '(/) {color:green}+1 jdk8 hadoop3 checks{color}' >> 
"${OUTPUT_DIR}/commentfile"
+                echo '(/) {color:green}+1 jdk8 hadoop3 checks{color}' > 
"${OUTPUT_DIR}/commentfile"
               else
-                echo '(x) {color:red}-1 jdk8 hadoop3 checks{color}' >> 
"${OUTPUT_DIR}/commentfile"
+                echo '(x) {color:red}-1 jdk8 hadoop3 checks{color}' > 
"${OUTPUT_DIR}/commentfile"
                 status=1
               fi
               echo "-- For more information [see jdk8 (hadoop3) 
report|${BUILD_URL}/JDK8_Nightly_Build_Report_(Hadoop3)/]" >> 
"${OUTPUT_DIR}/commentfile"
@@ -430,6 +450,7 @@ curl -L  -o personality.sh "${env.PROJECT_PERSONALITY}"
               rm -rf "unpacked_src_tarball" && mkdir "unpacked_src_tarball"
               rm -rf ".m2-for-repo" && mkdir ".m2-for-repo"
               rm -rf ".m2-for-src" && mkdir ".m2-for-src"
+              echo '(x) {color:red}-1 source release artifact{color}\n-- 
Something went wrong with this stage, [check relevant console 
output|${BUILD_URL}/console].' >output-srctarball/commentfile
 '''
             dir('component') {
               checkout scm
@@ -484,7 +505,7 @@ curl -L  -o personality.sh "${env.PROJECT_PERSONALITY}"
            echo currentBuild.durationString
            def comment = "Results for branch ${env.BRANCH_NAME}\n"
            comment += "\t[build ${currentBuild.displayName} on 
builds.a.o|${env.BUILD_URL}]: "
-           if (currentBuild.result == "SUCCESS") {
+           if (currentBuild.result == null || currentBuild.result == 
"SUCCESS") {
               comment += "(/) *{color:green}+1 overall{color}*\n"
            } else {
               comment += "(x) *{color:red}-1 overall{color}*\n"

Reply via email to