HBASE-18467 WIP build up a jira comment.

HBASE-18467 WIP fail yetus checks instead of running.

WIP fixing syntax.

WIP switch to non-jenkins substituded string.

WIP adding attempt at using jira selector after all.

HBASE-18467 make sure placeholder failure for yetus writes console report.

HBASE-18467 more syntax.

HBASE-18467 WIP let's try using the changeset directly.

HBASE-18467 WIP assemble comment contents.

HBASE-18467 WIP, doesn't look like newlines are cool with groovy.

HBASE-18467 WIP ah, it was that you can't have newlines in var names.

HBASE-18467 WIP more debugging. ugh.

HBASE-18467 WIP


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

Branch: refs/heads/HBASE-18467
Commit: c2537ac6d865f511f19989a580702215be25f8f7
Parents: 13028d7
Author: Sean Busbey <bus...@apache.org>
Authored: Wed Aug 9 00:48:46 2017 -0500
Committer: Sean Busbey <bus...@apache.org>
Committed: Sun Aug 20 15:31:33 2017 -0500

----------------------------------------------------------------------
 dev-support/Jenkinsfile            | 104 ++++++++++++++++++++++++++++++--
 dev-support/hbase_nightly_yetus.sh |   7 +++
 2 files changed, 105 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/c2537ac6/dev-support/Jenkinsfile
----------------------------------------------------------------------
diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile
index 1f01a47..7207ab3 100644
--- a/dev-support/Jenkinsfile
+++ b/dev-support/Jenkinsfile
@@ -128,7 +128,17 @@ curl -L  -o personality.sh "${env.PROJET_PERSONALITY}"
       steps {
         unstash 'yetus'
         // TODO should this be a download from master, similar to how the 
personality is?
-        sh "${env.BASEDIR}/dev-support/hbase_nightly_yetus.sh"
+        sh '''#!/usr/bin/env bash
+          declare commentfile
+          if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
+            commentfile="${OUTPUTDIR}/success"
+            echo '(/) *{color:green}+1 general checks{color}*' >> 
"${commentfile}"
+          else
+            commentfile="${OUTPUTDIR}/failure"
+            echo '(x) *{color:red}-1 general checks{color}*' >> 
"${commentfile}"
+          fi
+          echo '-- For more information [see general 
report|${BUILD_URL}/General_Nightly_Build_Report/]' >> "${commentfile}"
+        '''
       }
       post {
         always {
@@ -159,13 +169,21 @@ curl -L  -o personality.sh "${env.PROJET_PERSONALITY}"
       }
       steps {
         unstash 'yetus'
-        sh """#!/usr/bin/env bash
+        sh '''#!/usr/bin/env bash
           # for branch-1.1 we don't do jdk8 findbugs, so do it here
-          if [ "${env.BRANCH_NAME}" == "branch-1.1" ]; then
+          if [ "${BRANCH_NAME}" == "branch-1.1" ]; then
             TESTS+=",findbugs"
           fi
-          "${env.BASEDIR}/dev-support/hbase_nightly_yetus.sh"
-        """
+          declare commentfile
+          if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
+            commentfile='${OUTPUTDIR}/success'
+            echo '(/) *{color:green}+1 jdk7 checks{color}*' >> "${commentfile}"
+          else
+            commentfile='${OUTPUTDIR}/failure'
+            echo '(x) *{color:red}-1 jdk7 checks{color}*' >> "${commentfile}"
+          fi
+          echo '-- For more information [see jdk7 
report|${BUILD_URL}/JDK7_Nightly_Build_Report/]' >> "${commentfile}"
+        '''
       }
       post {
         always {
@@ -215,7 +233,17 @@ curl -L  -o personality.sh "${env.PROJET_PERSONALITY}"
       }
       steps {
         unstash 'yetus'
-        sh "${env.BASEDIR}/dev-support/hbase_nightly_yetus.sh"
+        sh '''#!/usr/bin/env bash
+          declare commentfile
+          if "${BASEDIR}/dev-support/hbase_nightly_yetus.sh" ; then
+            commentfile='${OUTPUTDIR}/success'
+            echo '(/) *{color:green}+1 jdk8 checks{color}*' >> "${commentfile}"
+          else
+            commentfile='${OUTPUTDIR}/failure'
+            echo '(x) *{color:red}-1 jdk8 checks{color}*' >> "${commentfile}"
+          fi
+          echo '-- For more information [see jdk8 
report|${BUILD_URL}/JDK8_Nightly_Build_Report/]' >> "${commentfile}"
+        '''
       }
       post {
         always {
@@ -304,6 +332,70 @@ END
           fi
 '''
       }
+      // This approach only works because the source release artifact is the 
last stage that does work.
+      post {
+        success {
+          writeFile file: "${env.WORKSPACE}/src_tarball_success", text: '(/) 
*{color:green}+1 source release artifact{color}*'
+        }
+        failure {
+          writeFile file: "${env.WORKSPACE}/src_tarball_failure", text: '(x) 
*{color:red}-1 source release artifact{color}*'
+        }
+      }
+    }
+    stage ('Fail if previous stages failed') {
+      steps {
+        script {
+          def failures = ['src_tarball_failure', 
"${env.OUTPUT_RELATIVE_GENERAL}/failure",
+                          "${env.OUTPUT_RELATIVE_JDK7}/failure", 
"${OUTPUT_RELATIVE_JDK8}/failure"]
+          for ( failure_file in failures ) {
+            if (fileExists(file: failure_file)) {
+              error 'Failing job due to previous failure(s) in prior steps.'
+            }
+          }
+        }
+      }
+    }
+  }
+  post {
+    always {
+      script {
+         sh "printenv"
+         def results = ["${env.OUTPUT_RELATIVE_GENERAL}/failure", 
"${env.OUTPUT_RELATIVE_GENERAL}/success",
+                        "${env.OUTPUT_RELATIVE_JDK7}/failure", 
"${env.OUTPUT_RELATIVE_JDK7}/success",
+                        "${env.OUTPUT_RELATIVE_JDK8}/failure", 
"${env.OUTPUT_RELATIVE_JDK8}/success",
+                        'src_tarball_failure', 'src_tarball_success']
+         echo env.BRANCH_NAME
+         echo env.BUILD_URL
+         echo currentBuild.result
+         echo currentBuild.durationString
+         def comment = "Results for branch ${env.BRANCH_NAME}, done in 
${currentBuild.durationString}\n"
+         if (currentBuild.result == "SUCCESS") {
+            comment += '       (/) *{color:green}+1 overall{color}*\\'
+         } else {
+            comment += '(x) *{color:red}-1 overall{color}*\\'
+            // Ideally get the committer our of the change and @ mention them 
in the per-jira comment
+            comment += 'Committer, please check your recent inclusion of a 
patch for this issue.\\'
+         }
+         comment += "  [build ${currentBuild.displayName} on 
builds.a.o|${env.BUILD_URL}]: ${currentBuild.result}\\----\\details (if 
available):"
+         echo "Comment so far: "
+         echo comment
+         echo ""
+         echo "trying to aggregate step-wise results"
+         comment += results.collect { fileExists(file: it) ? readFile(file: 
it) : "\n" }.join
+         echo comment
+         echo "${currentBuild.changeSets.size} changes"
+         for ( change in currentBuild.changeSets ) {
+           echo "change:"
+           echo "      ${change.getAuthor}"
+           echo "      ${change.getMsg}"
+           echo "      ${change.getMsgAnnotated}"
+           echo ""
+           // figure out jira  from the message
+           // dedup jiras we already commented on
+           // comment, something like
+           // jiraComment issueKey: currentIssue, body: comment
+         }
+      }
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/hbase/blob/c2537ac6/dev-support/hbase_nightly_yetus.sh
----------------------------------------------------------------------
diff --git a/dev-support/hbase_nightly_yetus.sh 
b/dev-support/hbase_nightly_yetus.sh
index 007d64a..5920a81 100755
--- a/dev-support/hbase_nightly_yetus.sh
+++ b/dev-support/hbase_nightly_yetus.sh
@@ -16,6 +16,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# XXX Don't commit this part.
+# fail fast
+mkdir -p "${OUTPUTDIR}"
+echo "placeholder" >> "${OUTPUTDIR}/console-report.html"
+exit 1772
+# /XXX Don't commit this part.
+
 declare -i missing_env=0
 # Validate params
 for required_env in "TESTS" "TOOLS" "BASEDIR" "ARCHIVE_PATTERN_LIST" 
"OUTPUT_RELATIVE" \

Reply via email to