gitlab-ci-local
gitlab-ci-local copied to clipboard
Implement variable usage in rules:exists
.gitlab-ci.yml illustrating the issue:
variables:
MY_FILE: example.txt
stages:
- build
this runs:
stage: build
script:
- echo $CI_JOB_NAME
this does not:
stage: build
script:
- echo $CI_JOB_NAME
rules:
- exists:
- $MY_FILE
example.txt:
blablabla
Expected behavior Both jobs should run as they do on GitLab (see this pipeline)
Host information Ubuntu 22.04
$ gitlab-ci-local --version
4.45.2
$ docker --version
Docker version 24.0.7, build afdd53b
I'm pretty sure this is in fact a feature request. I'll have to checkup, but labeling it feature for now.
Hi thanks for the quick response. It's a bit more subtle than the new issue title suggests, because "rules: exists" is already working when the target filename is referenced directly in a "rules: exists: [filename]". It just doesn't work when the filename is provided indirectly via a variable.
I've updated my example to better show this.
This isn't super important or blocking my use of gitlab-ci-local
, I just thought you should know.
Thanks!
Ooooh.... LoL I didn't even realise we've implemented rules exists 😁