So lets say I have a project structure like:
project-fancy-name
-> jobs
-> build
- build-maven.yml
-> defaults
- maven-defaults.yml
And in the build-maven.yml I want to include the defaults-maven.yml file.
I have tried the below combinations but all seem to give me this error or similar:Local file defaults/maven-defaults.yml does not exist!
include:
- local: defaults/maven-defaults.yml
include:
- local: /defaults/maven-defaults.yml
include:
- local: ./defaults/maven-defaults.yml
include:
- local: ../defaults/maven-defaults.yml
I was under the impression that using ../ may have gone back a directory but doesn't seem to be the case.
So what would the correct syntax be for including the local file maven-defaults.yml in the build-maven.yml file?
I have read the Gitlab Include reference material but it doesn't seem to give any examples that would work here.
include: paths are relative to the project root, not relative to the file location. So just include the full path, relative to the project root:
include:
- local: jobs/defaults/maven-defaults.yml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With