I would like to use the "Script File" step in a Job to execute some bash scripts.
I'm trying to set up a scripts directory for a project, in order to keep all my script files together.
In some cases, script file A might be dependent on script file B, e.g.:
# -- file ScriptA.sh
#! /bin/env bash
#
# set up variables
. ScriptB.sh
#
How can I tell Rundeck about ScriptA.sh, and all its dependent scripts? How can I get them copied to the (temp) directory where they will be executed?
Rundeck does not handle a script file dependencies, you need to set them up in order to successfully run your script file.
Note: if your script files are not in the same folder, then you should explicitly call them with an absolute path and execute them with the sh
command.
Example:
# -- file scriptA.sh
#! /bin/env bash
#
# set up variables
sh /path/to/script/scriptB.sh
#