From b1772fbec2a6b55047751857c00b7d2c6332d7cd Mon Sep 17 00:00:00 2001 From: Duo Zhang Date: Thu, 7 Oct 2021 21:58:28 +0800 Subject: [PATCH] HBASE-26317 Publish the test logs for pre commit jenkins job to nightlies (#3715) Signed-off-by: Peter Somogyi --- dev-support/Jenkinsfile_GitHub | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dev-support/Jenkinsfile_GitHub b/dev-support/Jenkinsfile_GitHub index 9d891a1eeba..834f5e4a38c 100644 --- a/dev-support/Jenkinsfile_GitHub +++ b/dev-support/Jenkinsfile_GitHub @@ -52,6 +52,7 @@ pipeline { WORKDIR_REL_GENERAL_CHECK = 'yetus-general-check' WORKDIR_REL_JDK8_HADOOP2_CHECK = 'yetus-jdk8-hadoop2-check' WORKDIR_REL_JDK11_HADOOP3_CHECK = 'yetus-jdk11-hadoop3-check' + ASF_NIGHTLIES = 'https://nightlies.apache.org' } parameters { @@ -213,6 +214,25 @@ pipeline { echo "No archiver directory, skipping compressing." fi ''' + sshPublisher(publishers: [ + sshPublisherDesc(configName: 'Nightlies', + transfers: [ + sshTransfer(remoteDirectory: "hbase/${JOB_NAME}/${BUILD_NUMBER}", + sourceFiles: "${env.WORKDIR_REL}/${env.PATCH_REL}/test_logs.zip" + ) + ] + ) + ]) + // remove the big test logs zip file, store the nightlies url in test_logs.txt + sh '''#!/bin/bash -e + if [ -f "${PATCHDIR}/test_logs.zip" ]; then + echo "Remove ${PATCHDIR}/test_logs.zip for saving space" + rm -rf "${PATCHDIR}/test_logs.zip" + echo "${ASF_NIGHTLIES}/hbase/${JOB_NAME}/${BUILD_NUMBER}/${WORKDIR_REL}/${PATCH_REL}/test_logs.zip" > "${PATCHDIR}/test_logs.txt" + else + echo "No test_logs.zip, skipping" + fi + ''' // Has to be relative to WORKSPACE. archiveArtifacts artifacts: "${WORKDIR_REL}/${PATCH_REL}/*", excludes: "${WORKDIR_REL}/${PATCH_REL}/precommit" archiveArtifacts artifacts: "${WORKDIR_REL}/${PATCH_REL}/**/*", excludes: "${WORKDIR_REL}/${PATCH_REL}/precommit/**/*" @@ -315,6 +335,25 @@ pipeline { echo "No archiver directory, skipping compressing." fi ''' + sshPublisher(publishers: [ + sshPublisherDesc(configName: 'Nightlies', + transfers: [ + sshTransfer(remoteDirectory: "hbase/${JOB_NAME}/${BUILD_NUMBER}", + sourceFiles: "${env.WORKDIR_REL}/${env.PATCH_REL}/test_logs.zip" + ) + ] + ) + ]) + // remove the big test logs zip file, store the nightlies url in test_logs.txt + sh '''#!/bin/bash -e + if [ -f "${PATCHDIR}/test_logs.zip" ]; then + echo "Remove ${PATCHDIR}/test_logs.zip for saving space" + rm -rf "${PATCHDIR}/test_logs.zip" + echo "${ASF_NIGHTLIES}/hbase/${JOB_NAME}/${BUILD_NUMBER}/${WORKDIR_REL}/${PATCH_REL}/test_logs.zip" > "${PATCHDIR}/test_logs.txt" + else + echo "No test_logs.zip, skipping" + fi + ''' // Has to be relative to WORKSPACE. archiveArtifacts artifacts: "${WORKDIR_REL}/${PATCH_REL}/*", excludes: "${WORKDIR_REL}/${PATCH_REL}/precommit" archiveArtifacts artifacts: "${WORKDIR_REL}/${PATCH_REL}/**/*", excludes: "${WORKDIR_REL}/${PATCH_REL}/precommit/**/*"