From ae68083e7a679225df2022a58305dfccae50c9f9 Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Thu, 7 Oct 2021 21:57:21 +0800 Subject: [PATCH] HBASE-26313 Publish the test logs for our nightly jobs to nightlies.apache.org (#3713) Signed-off-by: Peter Somogyi --- dev-support/Jenkinsfile | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/dev-support/Jenkinsfile b/dev-support/Jenkinsfile index 73a6f7e155b..204aaa2adcd 100644 --- a/dev-support/Jenkinsfile +++ b/dev-support/Jenkinsfile @@ -49,6 +49,7 @@ pipeline { // These tests currently have known failures. Once they burn down to 0, remove from here so that new problems will cause a failure. TESTS_FILTER = 'cc,checkstyle,javac,javadoc,pylint,shellcheck,whitespace,perlcritic,ruby-lint,rubocop,mvnsite,xml' EXCLUDE_TESTS_URL = "${JENKINS_URL}/job/HBase/job/HBase-Find-Flaky-Tests/job/${BRANCH_NAME}/lastSuccessfulBuild/artifact/output/excludes" + ASF_NIGHTLIES = 'https://nightlies.apache.org' } parameters { booleanParam(name: 'USE_YETUS_PRERELEASE', defaultValue: false, description: '''Check to use the current HEAD of apache/yetus rather than our configured release. @@ -258,6 +259,25 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" else echo "No archiver directory, skipping compressing." fi +''' + sshPublisher(publishers: [ + sshPublisherDesc(configName: 'Nightlies', + transfers: [ + sshTransfer(remoteDirectory: "hbase/${JOB_NAME}/${BUILD_NUMBER}", + sourceFiles: "${env.OUTPUT_DIR_RELATIVE}/test_logs.zip" + ) + ] + ) + ]) + // remove the big test logs zip file, store the nightlies url in test_logs.txt + sh '''#!/bin/bash -e + if [ -f "${OUTPUT_DIR}/test_logs.zip" ]; then + echo "Remove ${OUTPUT_DIR}/test_logs.zip for saving space" + rm -rf "${OUTPUT_DIR}/test_logs.zip" + echo "${ASF_NIGHTLIES}/hbase/${JOB_NAME}/${BUILD_NUMBER}/${OUTPUT_DIR_RELATIVE}/test_logs.zip" > "${OUTPUT_DIR}/test_logs.txt" + else + echo "No test_logs.zip, skipping" + fi ''' // Has to be relative to WORKSPACE. archiveArtifacts "${env.OUTPUT_DIR_RELATIVE}/*" @@ -337,6 +357,25 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" else echo "No archiver directory, skipping compressing." fi +''' + sshPublisher(publishers: [ + sshPublisherDesc(configName: 'Nightlies', + transfers: [ + sshTransfer(remoteDirectory: "hbase/${JOB_NAME}/${BUILD_NUMBER}", + sourceFiles: "${env.OUTPUT_DIR_RELATIVE}/test_logs.zip" + ) + ] + ) + ]) + // remove the big test logs zip file, store the nightlies url in test_logs.txt + sh '''#!/bin/bash -e + if [ -f "${OUTPUT_DIR}/test_logs.zip" ]; then + echo "Remove ${OUTPUT_DIR}/test_logs.zip for saving space" + rm -rf "${OUTPUT_DIR}/test_logs.zip" + echo "${ASF_NIGHTLIES}/hbase/${JOB_NAME}/${BUILD_NUMBER}/${OUTPUT_DIR_RELATIVE}/test_logs.zip" > "${OUTPUT_DIR}/test_logs.txt" + else + echo "No test_logs.zip, skipping" + fi ''' // Has to be relative to WORKSPACE. archiveArtifacts "${env.OUTPUT_DIR_RELATIVE}/*" @@ -423,6 +462,25 @@ curl -L -o personality.sh "${env.PROJECT_PERSONALITY}" else echo "No archiver directory, skipping compressing." fi +''' + sshPublisher(publishers: [ + sshPublisherDesc(configName: 'Nightlies', + transfers: [ + sshTransfer(remoteDirectory: "hbase/${JOB_NAME}/${BUILD_NUMBER}", + sourceFiles: "${env.OUTPUT_DIR_RELATIVE}/test_logs.zip" + ) + ] + ) + ]) + // remove the big test logs zip file, store the nightlies url in test_logs.txt + sh '''#!/bin/bash -e + if [ -f "${OUTPUT_DIR}/test_logs.zip" ]; then + echo "Remove ${OUTPUT_DIR}/test_logs.zip for saving space" + rm -rf "${OUTPUT_DIR}/test_logs.zip" + echo "${ASF_NIGHTLIES}/hbase/${JOB_NAME}/${BUILD_NUMBER}/${OUTPUT_DIR_RELATIVE}/test_logs.zip" > "${OUTPUT_DIR}/test_logs.txt" + else + echo "No test_logs.zip, skipping" + fi ''' // Has to be relative to WORKSPACE. archiveArtifacts "${env.OUTPUT_DIR_RELATIVE}/*"