Skip to content

Conversation

coder-hugo
Copy link

I haven't found any existing solution for this and I also haven't got an answer for my question in the jenkins-users group. Therefore I just implemented a global variable that provides access to the Jenkins proxy settings in pipelines.
I think this plugin is a good place for such a variable. But if you are thinking differently I can move this also to a separate plugin.

jglick
jglick previously requested changes May 30, 2017
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better done as a separate plugin. Rather than a global variable, would suggest a block-scoped step setting an EnvironmentExpander with relevant environment variables—ideally the semistandard ones like http_proxy (IIRC), so typical third-party applications would be able to pick up the proxy settings without any special arguments.

<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
<version>2.22</version>
<scope>test</scope>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not want this dep here.

@coder-hugo
Copy link
Author

I just changed my PR according to your suggestion. There is now a step (withHttpProxyEnv) that provides the global proxy settings as the following environment variables:

  • http_proxy/HTTP_PROXY
  • https_proxy/HTTPS_PROXY
  • no_proxy/NO_PROXY

I add both the lower case and the upper case format as there are commands that like just the lower case format and others that just like the upper case one.

@shiranhonigFiverr
Copy link

Hello,
Is this fix about to be merged? is there another solution for this problem?
Thanks!

@jglick jglick dismissed their stale review May 21, 2018 14:21

stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants