Skip to content

Commit

Permalink
[Misc] Putting back previous implementation of artifact archiving sin…
Browse files Browse the repository at this point in the history
…ce the new solution doesn't work (seems to be an issue with the "sh" step) + the tmp-jenkins-* directories are not cleaned anywhere and thus they accumulate more and more old artifacts at each job execution!
  • Loading branch information
vmassol committed Apr 5, 2019
1 parent f31ef09 commit 411cf4d
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions vars/xwikiBuild.groovy
Expand Up @@ -182,26 +182,18 @@ void call(name = 'Default', body)
}

// Save videos generated by Docker-based tests, if any
// Note: We use the "find" shell command since there's some limitation currently with archiveArtifacts,
// This can generate some not nice stack trace in the logs,
// see https://issues.jenkins-ci.org/browse/JENKINS-51913
echoXWiki "Looking for test videos in ${pwd()}"
sh "find . -path '*/target/*' -not \\( -path '*/tmp-jenkins-flv/*' -prune \\)\
-type f -name '*.flv' -exec rsync -R {} 'tmp-jenkins-flv/' \\;"
dir('tmp-jenkins-flv') {
archiveArtifacts artifacts: '**', allowEmptyArchive: true
}
echoXWiki "Looking for test failure videos in ${pwd()}"
archiveArtifacts artifacts: '*/target/*', allowEmptyArchive: true

// Save images generated by functional tests, if any
// Note: We use the "find" shell command since there's some limitation currently with archiveArtifacts,
// This can generate some not nice stack trace in the logs,
// see https://issues.jenkins-ci.org/browse/JENKINS-51913
// Note: we look for screenshots only in the screenshots directory to avoid false positives such as PNG images
// that would be located in a XWiki distribution located in target/.
echoXWiki "Looking for test failure images in ${pwd()}"
sh "find . -path '*/target/*/screenshots' -not \\( -path '*/tmp-jenkins-png/*' -prune \\)\
-type f -name '*.png' -exec rsync -R {} 'tmp-jenkins-png/' \\;"
dir('tmp-jenkins-png') {
archiveArtifacts artifacts: '**', allowEmptyArchive: true
}
archiveArtifacts artifacts: '*/target/*/screenshots', allowEmptyArchive: true

echoXWiki "Current build status after withMaven execution: ${currentBuild.result}"

Expand Down

0 comments on commit 411cf4d

Please sign in to comment.