I use the bash built-in 'source' command which executes the script in the context of the current shell. For the purposes of this plugin, doing so will load any exported environment variables into the shell environment. Once the shell is closed, the variables exported into it are gone as well. This is why, if I execute 5 differed shell build steps, I must source the environment file in each build step.

As an example, if my script called environment.anything contains:

#!/bin/bash

export MY_VARIABLE="Test Variable"

This would be possible in a shell:

<user@machine> source environment.anything
<user@machine> echo $MY_VARIABLE
Test Variable

You can read about shells Here but the 'source' command should be supported by most major shell types.

Ultimately, I'd like to be able to source a script which sets up my job environment such that all my build steps also share that environment.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to