Skip to content

Commit

Permalink
[JENKINS-69711] Promotion configuration is lost when creating a new j…
Browse files Browse the repository at this point in the history
…ob by copy (#263)
  • Loading branch information
basil authored Oct 18, 2023
1 parent 8dba927 commit a571aab
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ public boolean accept(File child) {
if (subdirs != null) {
prop = ((Job<?,?>)item).getProperty(JobPropertyImpl.class);
for (File subdir : subdirs) try {
File dest = prop.getRootDirFor(subdir.getName());
Files.createDirectories(dest.toPath());
Files.copy(
new File(subdir, "config.xml").toPath(),
new File(prop.getRootDirFor(subdir.getName()), "config.xml").toPath(),
new File(dest, "config.xml").toPath(),

Check warning on line 44 in src/main/java/hudson/plugins/promoted_builds/CopyListener.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 40-44 are not covered by tests
StandardCopyOption.REPLACE_EXISTING);
} catch (InvalidPathException | IOException e) {
Logger.getLogger(CopyListener.class.getName()).log(Level.WARNING,
Expand Down

0 comments on commit a571aab

Please sign in to comment.