Page History
...
Script Includes are managed from the Configuration view , for example for a number of use cases.
Use Case: Global Functions
This use case include to define functions, e.g. for bash scripts, that can be used across job scripts in a number of workflows:
Use Case: Environment Variables
Script Includes can similarly be used to define environment variables that are used in a number of shell scripts:
...
- Use of JS7 - Job Resources is preferable if the only purpose of the Script Include is to publish environment variables to shell scripts.
Use Case: Shebang Replacement
Script Includes can be used as a shebang replacement:
Hint:
- The somewhat cryptic line in fact allows to add multi-line PowerShell code to job scripts for Windows, see JS7 - How to run PowerShell scripts from jobs
Applying Script Includes
Use Case: Global Functions
Script Includes can be applied to any Shell Jobs. Consider the example of a workflow that includes a Shell Job like this:
...
The job script in the above workflow looks like this:
Use Case: Shebang Replacement
The above example of a Script Include that hides the complexity of a shebang replacement for PowerShell with Windows is applied like this:
Adding Script Includes to a Job Script
Script Includes can be added to a job script in a number of ways:
...