From 49d73e26f7ff74a7872d00b856af003745ef2dbb Mon Sep 17 00:00:00 2001 From: sophia-guo Date: Mon, 3 Jun 2024 18:55:57 -0400 Subject: [PATCH] Archive all taps after parallel run (#1041) * Archive all taps after parallel run Access archived tap file from jobs archive directory Signed-off-by: Sophia Guo * Using CopyArtifact to grab all tap files Signed-off-by: Sophia Guo --------- Signed-off-by: Sophia Guo --- pipelines/build/common/build_base_file.groovy | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pipelines/build/common/build_base_file.groovy b/pipelines/build/common/build_base_file.groovy index 4d335bf2c..81b76c161 100644 --- a/pipelines/build/common/build_base_file.groovy +++ b/pipelines/build/common/build_base_file.groovy @@ -1006,6 +1006,34 @@ class Builder implements Serializable { } } context.parallel jobs + if (enableTests) { + def tarTap = 'AQAvitTapFiles.tar.gz' + def tarDir = 'AQAvitTaps' + context.node('worker') { + context.copyArtifacts( + projectName: env.JOB_NAME, + selector: context.specific("${env.BUILD_NUMBER}"), + filter: 'target/**/*.tap', + fingerprintArtifacts: true, + target: "${tarDir}/", + flatten: true, + optional: true + ) + // Archive tap files as a single tar file + context.sh """ + cd ${tarDir}/ + tar -czf ${tarTap} *.tap + """ + try { + context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') { + context.archiveArtifacts artifacts: "${tarDir}/${tarTap}" + } + } catch (FlowInterruptedException e) { + throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...") + } + } + } + // publish to github if needed // Don't publish release automatically if (publish || release) {