-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitlab-ci.yml file can be split to increase readability #222
Comments
Thanks for raising this issue, @aboe76. Just some initial responses for now.
|
@myii, if I'm not correct most of the gitlab-ci.yml that doesn't change to often could stay in the ssf-formula and only be included in the main gitlab-ci.yml file directly without the need to copy/merge those files. this is a more comprehensive example location: |
I'm just learning more from gitlab, because the company I work for has been accepted into the partners.gitlab.com program, so I got a lot of useful information that I still need to figure out, but this was one of the first things that came to mind. |
Hello. In my work, we setup quite a few gitlab CI pipelines and I'm now more confident on how it's working. I have a personal repository where I'm pushing some common jobs templates.
I agree, that the reason I only define hidden template jobs to be extended by user in their
I propose to put the
The usage of For example: include:
# We include the definitions before using them
- project: baby-gnu/ci-tools
ref: main
file: /templates/Rules.yaml
- project: baby-gnu/ci-tools
ref: main
file: /templates/Git.yaml
stages:
- lint
commitlint: {extends: '.git:commitlint'}
I think this is not an issue because:
The extends keyword is a good replacement of YAML anchors.
This could be investigated in a second (or third) time, but I'm not sure it will be an improvement over defining several jobs which are run in parallel. |
Is your feature request related to a problem?
gitlab-ci.yml is now a big long file with different tasks, which is hard to read and understand.
Describe the solution you'd like
gitlab-ci.yml file has the option to include external yml files:
see: https://docs.gitlab.com/ee/ci/yaml/#include
Especially the local and remote includes are interesting.
Describe alternatives you've considered
not needed
Additional context
improve readability and interoperability between the formulas is also possible.
No need to duplicate code (dry)
The text was updated successfully, but these errors were encountered: