Save variables in env singleton

30 views
Skip to first unread message

kods...@gmail.com

unread,
Apr 3, 2017, 10:05:39 AM4/3/17
to Jenkins Users
Hi,

I'm using env singleton to store variables to be used at later stage in same pipeline. It is working nice but documentation about env is confusing.

1) https://www.cloudbees.com/blog/top-10-best-practices-jenkins-pipeline-plugin - Don’t: Set environment variables with env global variable
2) https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#code-withenv-code-set-environment-variables - See the documentation for the env singleton for more information on environment variables.

It looks to me that env is a singleton to a single build - not a singleton to Jenkins instance. I see an point that withEnv is preferred in some places but saying don't use env without explaining why is confusing.

Regards

Kamil

 

 

Reply all
Reply to author
Forward
0 new messages