jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-47345] environment and withEnv not set some environment variables like http_proxy, https_proxy and no_proxy

Open
#444 1 comment 0 reactions 0 assignees View on GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
73
Forks
129
PR merge metrics
No merged PRs in 30d

Description

I setted-up in a jenkins pipeline some environment variables and tested to access them in a pipeline step:

environment {

...

http_proxy = 'http://xxx:xxx'

...

TOTO='titi'

}

...

stages {

stage('xxx') {

when { anyOf { branch "${env.STABLE_BRANCH}"; branch "${env.DEV_BRANCH}" } }

steps {

sh 'env'

sh 'env | grep TOTO'

sh 'env | grep http_proxy'

}

}

}

 

[...S3MX7KBEQ] Running shell script

+ env

+ grep TOTO

TOTO=titi

[Pipeline] sh

[...S3MX7KBEQ] Running shell script

+ env

+ grep http_proxy

[Pipeline] }

[Pipeline] // stage

[Pipeline] }

 

TOTO var is well found but never http_proxy. I've tested to write http_proxy in uppercase too but same behavior.

 

I've tested to setted http_proxy in withEnv but same behavior.

 

Thanks.

---
Originally reported by scraly, imported from: environment and withEnv not set some environment variables like http_proxy, https_proxy and no_proxy


  • status: Open
  • priority: Minor
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 20251215-220547

Raw content of original issue

I setted-up in a jenkins pipeline some environment variables and tested to access them in a pipeline step:

environment {
...

http_proxy = 'http://xxx:xxx'
...
TOTO='titi'
}
...
stages {
stage('xxx') {
when { anyOf { branch "${env.STABLE_BRANCH}"; branch "${env.DEV_BRANCH}" } }
steps {
sh 'env'
sh 'env | grep TOTO'
sh 'env | grep http_proxy'
}
}
}

 

[...S3MX7KBEQ] Running shell script
+ env
+ grep TOTO
TOTO=titi
[Pipeline] sh
[...S3MX7KBEQ] Running shell script
+ env
+ grep http_proxy
[Pipeline] }
[Pipeline] // stage
[Pipeline] }

 

TOTO var is well found but never http_proxy. I've tested to write http_proxy in uppercase too but same behavior.

 

I've tested to setted http_proxy in withEnv but same behavior.

 

Thanks.

  • environment: Jenkins 2.46.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.