Is it possible to run a pipeline on a specific runner? (not using tags)
Is it feasible to use environments
, or even gitlab runner exec
maybe?
Scenario:
Have an existing project with multiple runners already attached to it (specific project token used to register the runner) and has it's own associated tags (so can't change these either).
I'm adding a new runner, however need to test it first to ensure it works, but I need to force the pipeline to build on this machine, without changing any tags, or specific project of the runner.
You have two mechanisms by which you can attempt to isolate a new runner for testing:
use tags and private runner attachment (already called out).
To further expand on this... even in a draconian setup where you can't alter tags and whatnot -- you can always FORK the project.
In your new private fork, you can go to Settings >> CI/CD and override the .gitlab-ci.yml file in the Custom CI Configuration Path under the General Pipelines Settings. This allows you to git cp .gitlab-ci.yml .mycustomgitlab-ci.yml
and then simply git add
/git commit
/git push
and you're in business.
Opinion: If you cannot use the mechanisms in place to adjust the tags on the questionable runner and isolate a new forked project, this isn't a technical problem, it is a political problem.
Gitlab-runner exec....
Assuming you're using a shell gitlab runner...
/tmp/myrepo
/path/to/gitlab-runner exec shell {.gitlab-ci.yml target}
See https://docs.gitlab.com/runner/commands/#gitlab-runner-exec and a blog about it at https://substrakt.com/how-to-debug-gitlab-ci-builds-locally/
Canary the gitlab-runner for a single build.
You can spin up the gitlab-runner process to do N number of builds and then go back offline. See: https://docs.gitlab.com/runner/commands/#gitlab-runner-run-single
... This is not zero-impact, but will definitely limit the blast radius of any problems.