Thanks. I ended doing what I needed doing as part of the last stage instead of in post.
On Wednesday, June 14, 2017 at 9:54:06 PM UTC+3, Kevin Burnett wrote: > > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/30806026-862d-4b3d-8a07-e2d34595b14d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
