Trouble with !reference

I seem to be doing something wrong but I think I’m using !reference exactly as the doc describes.

Here’s the relevant section from .git-ci.yml:

.test:
    script:
        - echo this comes from .test

build:test:
    stage: build
    image: ${CI_REGISTRY}/sr/linux/containers/build/build:$CI_COMMIT_REF_NAME
    script:
        - !reference [.test, script]

And here’re the relevant lines from the run log:

$ .test
/usr/bin/bash: line 105: .test: command not found

Can anyone explain what I’m seeing? Or perhaps, what I need to do to get the behavior I’m expecting from the doc?

Hi, i didn’t try this keyword reference yet, but have you try with another world than “test” which is a GitLabCI keywod ?

NM. I think I’ve found it.

The !reference construction is very recent, gitlab 13.9. I’m apparently running 12.10.

aah ok, it’s a new feature indeed :slight_smile:

1 Like