refactor: split scripts into separate files
This patch splits each one of the pipeline steps into a separate .sh file. This is based on Ahmed's work in !528, but excludes the other improvements he has made.
To not block other pipeline improvement patches, as they would all need to rebase on this one, the scripts have been copied as they are into the .sh files, taking care of not making any cleanup:
- Scripts are run with bash, even when not needed, since Salsa was doing so already. Switching them to /bin/sh can be done in another patch.
- Scripts are invoked with the dot (".") command, so that they all run in the same environment, and all share the same variables. More care of imported/exported variables, and eventually dropping the dot command, can be done in another patch.
- Scripts run
set -ex
to print to stderr the invoked commands, and to exit with an error if any of the invoked commands fail. Making them more robust, changing the set toset -euxo pipefail
, can be done in another patch. - Yaml anchors and aliases (i.e. *anchor) have been replaced with the dot command, and this should lead to the same behaviour.
Co-authored-by: Ahmed Siam aahs.coder@gmail.com