Skip to content

Commit

Permalink
Using CopyArtifact to grab all tap files
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Guo <sophia.gwf@gmail.com>
  • Loading branch information
sophia-guo committed May 31, 2024
1 parent 2820c9e commit 53daa9c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions pipelines/build/common/build_base_file.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -997,14 +997,26 @@ class Builder implements Serializable {
}
context.parallel jobs
if (enableTests) {
def archiveDir = "${env.JENKINS_HOME}/jobs/${env.JOB_NAME}/builds/${env.BUILD_NUMBER}/archive"
def tarTap = "AQAvitTapFiles.tar.gz"
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 "find ${archiveDir} -type f -name '*.tap' -exec tar -czf ${tarTap} {} + "
context.sh """
cd ${tarDir}/
tar -czf ${tarTap} *.tap
"""
try {
context.timeout(time: pipelineTimeouts.ARCHIVE_ARTIFACTS_TIMEOUT, unit: 'HOURS') {
context.archiveArtifacts artifacts: "${tarTap}"
context.archiveArtifacts artifacts: "${tarDir}/${tarTap}"
}
} catch (FlowInterruptedException e) {
throw new Exception("[ERROR] Archive AQAvitTapFiles.tar.gz timeout Exiting...")
Expand Down

0 comments on commit 53daa9c

Please sign in to comment.