$ source ansible/hacking/env-setupstage "deploy"
sh 'source /opt/ansible/hacking/env-setup"
sh 'ansible --version'To apply environment variables, you have to wrap your code in a
withEnv block, whose argument is an array of strings of the form
'VARIABLE=value'. So you could read the env-setup file and go
through line by line building up an environment array, then use
that array variable in the withEnv block. Or you could put all
your Ansible commands in a shell script, and include the "source
/opt/ansible/hacking/env-setup" as one of the first lines in the
script. You could use the writeFile step to create such a shell
script on the fly if desired.
--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/457a6cf4-2f48-4711-bea8-e48227f9ac3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
| Eric Pyle
|
|
Release Engineer |
|
Lebanon |
|
+1 603-277-3060 (T) |
|
+1 603-359-8670 (M) |
|
eric...@cd-adapco.com |
| http://www.cd-adapco.com |