-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.46.1
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.
[JENKINS-47345] environment and withEnv not set some environment variables like http_proxy, https_proxy and no_proxy
Component/s | New: workflow-basic-steps-plugin [ 21712 ] | |
Component/s | Original: pipeline [ 21692 ] |
Description |
Original:
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. |
New:
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. |