'Abstract contents of gitlab-ci file to only use "include"
I've a gitlab-ci file that works as is no problem, however, a question has been asked as to whether we can abstract the contents of this file/move this file to another repo and reference the file instead, and once called upon all stages within the file will run.
gitlab-ci.yml file
stages:
- deployment
test:
stage: deployment
trigger:
include: /reference/to/file.yml
The error I'm receiving is "No stages/jobs for this pipeline" - any help would be greatly appreciated
Solution 1:[1]
Try using the full URL to the location of the file:
test:
stage: deployment
trigger:
include:
remote: 'https://gitlab.com/awesome-project/raw/main/.before-script-template.yml'
See the docs on CI/CD Include Examples, include, and trigger.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Richard |