Today we offer a bunch of executors for most common workflows.
Maintaining the code for this executors is hard, and requires a lot of engineering effort.
Instead, we should think about the generic way that would allow us to achieve the same, but allow people to script completely what they need, and support additional executors of any kind.
Idea is to introduce a Generic executor that simply executes shell scripts, which are hooked to runner, and runner consumes stdout and stderr trying to replicate all functions already implemented.
[[runners]] executor = "generic" [runners.generic] prepare_script = "/path/to/prepare/script.sh" execute_script = "/path/to/execute/script.sh" cleanup_script = "/path/to/cleanup/script.sh"
The execution would be:
- execute prepare to create an environment for given identifier,
- multiple times run execute to run the specific shell commands,
- at the end run cleanup to teardown environment and free resources,
Each of these scripts would receive all configuration and script to execute:
- unique identifier of job,
- path to user script to execute,
- information about current execution stage: cloning, artifacts, user provided script, etc.
An administrator would be responsible for maintaining the lifecycle of resource, including removing stale resources if runner is killed or dead.