Skip to content

Commit

Permalink
Copying AAR/JAR/WAR artifacts from last successful build
Browse files Browse the repository at this point in the history
These will be used for post-processing AAR/JAR/WAR files for more precise lastModified tracking,
with the goal being XML sitemaps for javadocs
  • Loading branch information
ao-apps committed Sep 4, 2023
1 parent a5df191 commit 9f0419a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Jenkinsfile
Expand Up @@ -551,6 +551,9 @@ pipeline {
quietPeriod(quietPeriod)
skipDefaultCheckout()
timeout(time: 2, unit: 'HOURS')
// Only allowed to copy build artifacts from self
// See https://plugins.jenkins.io/copyartifact/
copyArtifactPermission("/${JOB_NAME}")
// See https://plugins.jenkins.io/build-history-manager/
buildDiscarder(BuildHistoryManager([
[
Expand Down Expand Up @@ -926,6 +929,17 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1
// Make sure working tree not modified by build or test
sh checkTreeUnmodifiedScriptBuild(niceCmd)
dir(projectDir) {
// Download artifacts from last successful build of this job
// See https://plugins.jenkins.io/copyartifact/
// See https://www.jenkins.io/doc/pipeline/steps/copyartifact/#copyartifacts-copy-artifacts-from-another-project
copyArtifacts(
projectName: "/${JOB_NAME}",
selector: lastSuccessful(stable: false),
filter: '**/*.aar, **/*.jar, **/*.war',
target: 'target/last-successful-artifacts',
flatten: true,
optional: true
)
// Temporarily move surefire-reports before withMaven to avoid duplicate logging of test results
sh moveSurefireReportsScript()
withMaven(
Expand Down
14 changes: 14 additions & 0 deletions book/Jenkinsfile
Expand Up @@ -552,6 +552,9 @@ pipeline {
quietPeriod(quietPeriod)
skipDefaultCheckout()
timeout(time: 2, unit: 'HOURS')
// Only allowed to copy build artifacts from self
// See https://plugins.jenkins.io/copyartifact/
copyArtifactPermission("/${JOB_NAME}")
// See https://plugins.jenkins.io/build-history-manager/
buildDiscarder(BuildHistoryManager([
[
Expand Down Expand Up @@ -927,6 +930,17 @@ void deploySteps(niceCmd, projectDir, deployJdk, maven, mavenOpts, mavenOptsJdk1
// Make sure working tree not modified by build or test
sh checkTreeUnmodifiedScriptBuild(niceCmd)
dir(projectDir) {
// Download artifacts from last successful build of this job
// See https://plugins.jenkins.io/copyartifact/
// See https://www.jenkins.io/doc/pipeline/steps/copyartifact/#copyartifacts-copy-artifacts-from-another-project
copyArtifacts(
projectName: "/${JOB_NAME}",
selector: lastSuccessful(stable: false),
filter: '**/*.aar, **/*.jar, **/*.war',
target: 'target/last-successful-artifacts',
flatten: true,
optional: true
)
// Temporarily move surefire-reports before withMaven to avoid duplicate logging of test results
sh moveSurefireReportsScript()
withMaven(
Expand Down

0 comments on commit 9f0419a

Please sign in to comment.