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 d70188a commit 33318f9
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 7 deletions.
14 changes: 14 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,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 @@ -913,6 +916,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
2 changes: 1 addition & 1 deletion all
Submodule all updated 2 files
+14 −0 Jenkinsfile
+14 −0 book/Jenkinsfile
2 changes: 1 addition & 1 deletion bom
Submodule bom updated 2 files
+14 −0 Jenkinsfile
+14 −0 book/Jenkinsfile
14 changes: 14 additions & 0 deletions book/Jenkinsfile
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion model
Submodule model updated 2 files
+14 −0 Jenkinsfile
+14 −0 book/Jenkinsfile
2 changes: 1 addition & 1 deletion servlet
Submodule servlet updated 2 files
+14 −0 Jenkinsfile
+14 −0 book/Jenkinsfile
2 changes: 1 addition & 1 deletion style
Submodule style updated 2 files
+14 −0 Jenkinsfile
+14 −0 book/Jenkinsfile
2 changes: 1 addition & 1 deletion taglib
Submodule taglib updated 2 files
+14 −0 Jenkinsfile
+14 −0 book/Jenkinsfile
2 changes: 1 addition & 1 deletion view
Submodule view updated 2 files
+14 −0 Jenkinsfile
+14 −0 book/Jenkinsfile

0 comments on commit 33318f9

Please sign in to comment.