i don't believe you can use the environment instruction in post, no.

but you can use 
withEnv: 
https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-withenv-code-set-environment-variables

On Wednesday, June 14, 2017 at 8:43:43 AM UTC-4, Idan Adar wrote:
>
> In a stage I can do the following: 
>
> stage ("Merge pull request") {
>          environment {
>             JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}')
>          }
>          ...
>          ...
>          steps {
>   
>          }
> }
>
> Can this done also in post?
>
> post {
>      success {
>          environment {         
>              JENKINSBOT = credentials('${JENKINSBOT_GHE_ACCESS_TOKEN}')
>      }
>
>      script {
>      
>      }
>   }
> }
>     
>
> Or is there any other way to ahchieve this?
>

-- 
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 jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a3beb8eb-353f-41cb-ada9-dccbe889b189%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to