Skip to content

Allow custom executor to configure shell.

Gordon Bleux requested to merge (removed):custom-executor-config-shell into main

What does this MR do?

The DTO of the config stage has been extended to allow custom executors to define the shell used for the step scripts rendered by the runner. The new value is optional and runners retain their behaviour should this feature not be used.

Why was this MR needed?

We have a custom executor implementation, which is able to create build environments with a variety of operating systems. Currently we have confgured multiple runners, with the only difference being the shell configuration value. Our custom executor is able to identify the OS of the created VM. This feature would allow the executor to forward this information to the runner. We would no longer have to set up runners for each type of OS/shell we want to provide.

What's the best way to test this MR?

You need a runner configuration, where the shell setting is explicitly omitted. In the example below the config stage have been set up to provide this information.

[[runners]]
  name = "custom_shell"
  url = "..."
  token = "..."
  # shell = "powershell" # omit this to allow the executor to provide this information
  executor = "custom"
  builds_dir = "/builds"
  cache_dir = "/cache"
  [runners.custom]
    config_exec = "/bin/echo"
    config_args = [ "{\"shell\": \"powershell\"}" ]

The step scripts in the run stage should be rendered as powershell syntax.

What are the relevant issue numbers?

This has been addressed in #26987

Merge request reports