Hey Aurélie,

I've tested with this pipeline (derived from yours) and I'm not able to
reproduce your issue :

pipeline {

    agent any

    environment {
        http_proxy = 'http://xxx:xxx'
        TOTO='titi'
    }

    stages {
        stage('xxx') {
            when { expression { true } }
            steps {
                sh 'env'
                sh 'env | grep TOTO'
                sh 'env | grep http_proxy'
            }
        }
    }
}

​
Can you test with this one ?
Moreover, can you also provide your Jenkins and related Pipeline
Declarative plugins versions ?

Nice to see another Toulousaing(neu) on this mailing list BTW :-)

Cheers
Michaël

2017-10-09 10:16 GMT+02:00 Aurélie Vache <[email protected]>:

> Hi,
>
> I nbeed in a jenkins pipeline to have an access to a http_proxy.
>
>
> In my environment variables in my Jenkinsfile I've etted my http proxy and
> an env var named TOTO, then in one of my steps I checked if env var exists:
>
> environment {
>     ...
>
>         http_proxy = 'http://xxx:xxx'
>         ...
>         TOTO='titi'
>     }
> ...
> stages {
>         stage('xxx') {
>             when { anyOf { branch "${env.STABLE_BRANCH}"; branch "${
> http://env.DEV _BRANCH}" } }
>     steps {
>                             sh 'env'
>                             sh 'env | grep TOTO'
>                             sh 'env | grep http_proxy'
>     }
> }
>     }
>
> Résultats :
>
> [...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 eists but not http proxy ?!
>
> I need this http proxy in my pipeline. is it something i missed?
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jenkinsci-users/247ced4e-4874-48c8-8470-7d6fd33c0d24%40googlegroups.
> com
> <https://groups.google.com/d/msgid/jenkinsci-users/247ced4e-4874-48c8-8470-7d6fd33c0d24%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAPO77c0X2ENigQiYkPb38N65-075p71FAT%3DyU9xU4Y%3Dko-znbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to