From 600807769782e98a4133d258e2f00b0baaf57023 Mon Sep 17 00:00:00 2001 From: Sean Busbey Date: Wed, 9 Aug 2017 00:48:46 -0500 Subject: [PATCH] HBASE-18467 WIP run all stages and build jira comments. Currently blocked by JENKINS-46358 --- dev-support/Jenkinsfile | 134 +++++++++++++++++++++++++++++++++++-- dev-support/hbase_nightly_yetus.sh | 7 ++ 2 files changed, 135 insertions(+), 6 deletions(-) diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile index 1f01a47..08621d6 100644 --- a/dev-support/Jenkinsfile +++ b/dev-support/Jenkinsfile @@ -18,6 +18,8 @@ pipeline { agent { node { label 'Hadoop' +// temp go to ubuntu since it seems like no one uses those +// label 'ubuntu' } } triggers { @@ -128,7 +130,18 @@ 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 + rm -f "${OUTPUTDIR}/success" "${OUTPUTDIR}/failure" + 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 +172,22 @@ 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 + rm -f "${OUTPUTDIR}/success" "${OUTPUTDIR}/failure" + 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 +237,18 @@ 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 + rm -f "${OUTPUTDIR}/success" "${OUTPUTDIR}/failure" + 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 { @@ -287,6 +320,7 @@ curl -L -o personality.sh "${env.PROJET_PERSONALITY}" } // expectation check largely based on HBASE-14952 sh '''#!/bin/bash -e + rm -rf "${env.WORKSPACE}/src_tarball_success" "${env.WORKSPACE}/src_tarball_failure" echo "Checking against things we don't expect to include in the source tarball (git related, hbase-native-client, etc.)" cat >known_excluded < + echo "[DEBUG] found jira key: ${currentIssue}" + if ( currentIssue in seenJiras ) { + echo "[DEBUG] already commented on ${currentIssue}." + } else { + echo "[INFO] commenting on ${currentIssue}." + jiraComment issueKey: currentIssue, body: comment + seenJiras << currentIssue + } + } + //TODO warn if no JIRA key found in message, email committer + } + } + } catch (Exception exception) { + echo "Got exception: ${exception}" + echo " ${exception.getStackTrace()}" + } + } } } } 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" \ -- 2.7.2