judo
judo copied to clipboard
Sharing code between scripts
The general problems are avoiding boilerplate, bootstrapping/setting up the environment, abstracting over OS- or distro-specific details, or providing a library of common functions for other scripts to use.
It might be useful to allow executing a series of commands/scripts over the selected hosts, while retaining the remote working directory contents in between:
judo \
-s scripts/bootstrap \
-s scripts/common \
-s scripts/install-python \
-c "python --version" \
some-hosts
Here, scripts/common
can rely on scripts/bootstrap
having been completed successfully, and scripts/install-python
can include a function library exported by scripts/common
, for example by running . scripts/common/$(uname)
or so.