BuildForge Help

Running Scripts Before a Command With .source

The system provides the ability to execute 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 execute a custom preparation command.

To try this feature out:

  1. Create a batch file on the system called mybatch.bat that echoes some sentence. Save the batch file to c:\temp.

  2. Create a new environment called "Step Variables."

  3. Add a variable called .source with a value of c:\temp\mybatch.bat.

  4. Edit the Say Hi step of the Hello World project, and set the step's environment to the newly created Step Variables environ.

  5. Run the project, and examine the log output for the step.

Notice the additional log data showing that the mybatch.bat file was executed before the step command. Some important notes on .source: