0

If I have multiple execute shell steps in a Jenkins build, how can I create an environment variable in a particular execute shell step that will still be available in a subsequent execute shell steps and in plugin fields? I specifically want to use the variable in the formatted email plugin.

sakurashinken
  • 3,940
  • 8
  • 34
  • 67
  • Possible duplicate of [Passing data between build steps in Jenkins](http://stackoverflow.com/questions/22366808/passing-data-between-build-steps-in-jenkins) – Gerold Broser May 03 '16 at 20:04
  • https://stackoverflow.com/questions/43879733/jenkinsfile-declarative-pipeline-defining-dynamic-env-vars/43881731#43881731 – Joe Apr 16 '21 at 06:43

1 Answers1

0

If nothing else works, you can always put the variables into a file , make that file and artifact which will be delivered to the next stage and then source that file in the next stage

Markus Mikkolainen
  • 3,397
  • 18
  • 21