Allow reading from custom CI/CD configuration filename (preserving default gitlab-ci.yml)
Description
For some GitLab installations (or individual repositories within GitLab installations) the CI_CONFIG_PATH
variable may be configured to a custom value so that CI/CD instructions are parsed from a filename other than the default .gitlab-ci.yml
.
Currently the gitlab-runner
exec
path reads from a fixed filename:
- https://gitlab.com/gitlab-org/gitlab-runner/-/blob/600fb99522fdff0aee87f9cc9d093f7fc0f7bd59/commands/exec.go#L133
- https://gitlab.com/gitlab-org/gitlab-runner/-/blob/600fb99522fdff0aee87f9cc9d093f7fc0f7bd59/helpers/gitlab_ci_yaml_parser/parser.go#L382-387
It'd be nice to be able to override this at the command-line to improve the support that gitlab-runner
has for running CI/CD locally for instances/repositories with custom CI config filenames.
Proposal
Add a command-line flag to the exec
command(s) that allows the user to (optionally) provide a filename to read CI/CD configuration from.