The system provides the ability to run a script on the server
before the system runs the command by defining a special environment
variable named .source. This allows you to load a set of environment
variables from a source file on the server, or run a custom preparation
command.
To try this feature out:
- Create a batch file on the system called mybatch.bat that echoes
some sentence. Save the batch file to C:\temp.
- Create a new environment called Step Variables.
- Add a variable named .source with a value of C:\temp\mybatch.bat.
- Set a step's environment to the newly created Step Variables environment.
- Run the project, and examine the log output for the step.
Notice the additional log data showing that the mybatch.bat file
was run before the step command. Some important notes on .source:
- The path specified cannot have arguments.
- On Windows® platforms, the script is invoked via call.
- On UNIX® platforms, the script must be in the native
shell syntax as it is sourced in the running shell.