I am trying to add my stages to sub yamls, and i need to share them with other repos so i want them to be in a shared repo
I have this working with include and local in the .gitlab-ci.yml
but when I moved the .yml to a different repo to be shard with the others I get
Included file .gitlab-ci.yml
does not have valid YAML syntax!
or
Included file https://git.com/group/folder/pipeline/-/raw/main/.static-analysis.yml
does not have valid YAML syntax!
I have tried the below to solve the issue.
image: python:3.9
stages:
- static-analysis
include:
- project: 'group/folder/templates/pipeline/'
ref: main
file: '.static-analysis.yml'
Included file .gitlab-ci.yml
does not have valid YAML syntax!
image: python:3.9
stages:
- static-analysis
include:
- remote: 'https://git.com/group/folder/pipeline/-/raw/main/.static-analysis.yml'
Included file https://git.com/group/folder/pipeline/-/raw/main/.static-analysis.yml
does not have valid YAML syntax!
I have got this to work with the following, but this will not share with the other repos
image: python:3.9
stages:
- static-analysis
include:
- local: '.static-analysis.yml'
.static-analysis.yml
job:
stage: static-analysis
script:
- echo "test"