Skip to content

Commit

Permalink
Use JENKINS_UC_DOWNLOAD_URL if provided
Browse files Browse the repository at this point in the history
Fixes #415
  • Loading branch information
nhojpatrick committed Mar 10, 2022
1 parent 0fc40e9 commit 75c592f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,9 @@ public String getPluginDownloadUrl(Plugin plugin) {

String jenkinsUcDownload = System.getenv("JENKINS_UC_DOWNLOAD");
String jenkinsUcDownloadUrl = System.getenv("JENKINS_UC_DOWNLOAD_URL");
if (StringUtils.isNotEmpty(pluginUrl)) {
if (StringUtils.isNotEmpty(jenkinsUcDownloadUrl)) {
urlString = appendPathOntoUrl(jenkinsUcDownloadUrl, pluginName, pluginVersion, pluginName + ".hpi");
} else if (StringUtils.isNotEmpty(pluginUrl)) {
urlString = pluginUrl;
} else if (pluginVersion.equals(Plugin.LATEST) && !StringUtils.isEmpty(jenkinsUcLatest)) {
urlString = appendPathOntoUrl(dirName(jenkinsUcLatest), "/latest", pluginName + ".hpi");
Expand All @@ -1184,8 +1186,6 @@ public String getPluginDownloadUrl(Plugin plugin) {
groupId = groupId.replace(".", "/");
String incrementalsVersionPath = String.format("%s/%s/%s-%s.hpi", pluginName, pluginVersion, pluginName, pluginVersion);
urlString = appendPathOntoUrl(cfg.getJenkinsIncrementalsRepoMirror(), groupId, incrementalsVersionPath);
} else if (StringUtils.isNotEmpty(jenkinsUcDownloadUrl)) {
urlString = appendPathOntoUrl(jenkinsUcDownloadUrl, pluginName, pluginVersion, pluginName + ".hpi");
} else if (StringUtils.isNotEmpty(jenkinsUcDownload)) {
urlString = appendPathOntoUrl(jenkinsUcDownload, "/plugins", pluginName, pluginVersion, pluginName + ".hpi");
} else {
Expand Down

0 comments on commit 75c592f

Please sign in to comment.