Skip to content

Commit

Permalink
Fix CCUD extension handling
Browse files Browse the repository at this point in the history
  • Loading branch information
welandaz committed Sep 17, 2024
1 parent c349bd6 commit 77799d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ private void inject(InjectionConfig config, Node node, FilePath nodeRootPath, Ma

List<FilePath> extensions = new ArrayList<>();
FilePath controllerRootPath = Jenkins.get().getRootPath();
for (Map.Entry<MavenExtension, String> entry : extensionsDigest.entrySet()) {
extensions.add(extensionsHandler.copyExtensionToAgent(entry.getKey(), controllerRootPath, nodeRootPath, entry.getValue()));
}

MavenExtension develocityMavenExtension = MavenExtension.getDevelocityMavenExtension(config.getMavenExtensionVersion());
extensions.add(extensionsHandler.copyExtensionToAgent(develocityMavenExtension, controllerRootPath, nodeRootPath, extensionsDigest.get(develocityMavenExtension)));
if (InjectionUtil.isInvalid(InjectionConfig.checkRequiredVersion(config.getCcudExtensionVersion()))) {
extensionsHandler.deleteExtensionFromAgent(MavenExtension.CCUD, nodeRootPath);
} else {
extensions.add(extensionsHandler.copyExtensionToAgent(MavenExtension.CCUD, controllerRootPath, nodeRootPath, extensionsDigest.get(MavenExtension.CCUD)));
}

boolean isUnix = isUnix(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public Map<MavenExtension, String> getExtensionDigests(Supplier<File> rootDir, I
MavenExtension develocityMavenExtension = MavenExtension.getDevelocityMavenExtension(injectionConfig.getMavenExtensionVersion());

getExtensionDigest(cacheDir, develocityMavenExtension).ifPresent(it -> extensionDigests.put(develocityMavenExtension, it));
getExtensionDigest(cacheDir, MavenExtension.CCUD).ifPresent(it -> extensionDigests.put(MavenExtension.CCUD, it));
if (InjectionUtil.isValid(InjectionConfig.checkRequiredVersion(injectionConfig.getCcudExtensionVersion()))) {
getExtensionDigest(cacheDir, MavenExtension.CCUD).ifPresent(it -> extensionDigests.put(MavenExtension.CCUD, it));
}

return extensionDigests;
}
Expand Down

0 comments on commit 77799d0

Please sign in to comment.