Allow runner selection by version
Release notes
Allow runner selection by version
Problem to solve
As a developer i want to be able to choose a runner by version, similarly to the tag mechanism. This way i can use new runner features like writing variables to GITLAB_ENV
. The current workaround would be to have version tags, but that seems redundant since the gitlab server already knows the versions of all runners. The tag approach also does not work if i don't have the necessary permissions to configure the tags in my gitlab instance.
Intended users
Developers/Platform Engineers (without admin rights to configure runner tags).
User experience goal
The user should be able to specify a minimum runner version in the UI and .gitlab-ci.yml
. It should be possible to be set on job level.
myjob:
runner_version: ">16.3"
Proposal
Further details
We have a gitlab instance with a bunch of runners that are 16.2.0
and 16.6.0
. I want to make sure that certain jobs only run on runners with version 16.6.0
since i am using GITLAB_ENV
to reformat the timestamp (no colons and pluses) and use it in an artifact name:
basic-timestamped-artifact-name:
before_script:
- echo "TIMESTAMP=$(date -d ${CI_COMMIT_TIMESTAMP} +'%Y%m%dT%H%M%S%Z')" >> $GITLAB_ENV
script:
- touch test.txt
artifacts:
name: ${CI_JOB_NAME}_${CI_COMMIT_REF_SLUG}_${TIMESTAMP}_${CI_COMMIT_SHORT_SHA}
paths:
- test.txt