Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Aug 31, 2023
1 parent d1c89d2 commit 627ef0e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,7 @@ under `Manage Jenkins` > `Manage Plugins` > `Advanced`.

To exclude the JFrog platform from going through a configured proxy, provide your JFrog platform's host details in
the `No Proxy Host` section. This should be a list of comma-separated hosts.
Keep in mind that the JFrog CLI is typically downloaded from releases.jfrog.io. You might want to think about adding
that to your list as well.
Notice that the JFrog CLI is typically downloaded from releases.jfrog.io. You may need to add that to your list as well.

## Jenkins Configuration as Code

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public Void invoke(File toolLocation, VirtualChannel channel) throws IOException
String artifactoryUrl = instance.inferArtifactoryUrl();
try (ArtifactoryManager manager = new ArtifactoryManager(artifactoryUrl, Secret.toString(instance.getCredentialsConfig().getUsername()),
Secret.toString(instance.getCredentialsConfig().getPassword()), Secret.toString(instance.getCredentialsConfig().getAccessToken()), buildInfoLog)) {
if (proxyConfiguration.isProxyConfigured() && !proxyConfiguration.shouldBypassProxy(artifactoryUrl)) {
if (proxyConfiguration.isProxyConfigured(artifactoryUrl)) {
manager.setProxyConfiguration(proxyConfiguration);
}
// Getting updated cli binary's sha256 form Artifactory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ public boolean isProxyConfigured() {
return StringUtils.isNotBlank(host);
}

/**
* Return true if the proxy is configured and not bypassed.
*
* @return true if the proxy is configured.
*/
public boolean isProxyConfigured(String url) {
return isProxyConfigured() && !shouldBypassProxy(url);
}

/**
* Return true if the host is matched to one of the 'No Proxy Host' patterns.
*
Expand Down

0 comments on commit 627ef0e

Please sign in to comment.