PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, October 9, 2022

[FIXED] How to compile multiple/different .gitlab-ci.yml file into a single .gitlab-ci.yml file located in a separate repository?

 October 09, 2022     continuous-integration, devops, gitlab, gitlab-ci, gitlab-ci.yml     No comments   

Issue

Is it possible to include multiple and different .gitlab-ci.yml file into a single file located in another subgroup/repository? If yes, then how can it be done?

What I want to do is to have a modular gitlab CI files which can be used by different subgrous and project repositories depending on what they need. I'm thinking on a scalability perspective, the reason why I thought of this is to avoid hard coding the ci file that will be used for a specific app/ source code and for them to pick a ci file that they will need.

Here's how I think it can be visualized: Gitlab Structure


Solution

You can include CI configuration files from other groups/projects irrespective of where your project lives in the hierarchy. You can do this using the include: directive.

# .gitlab-ci.yml in Repo D
include:
  - project: anygroup/anysubgroup/anyproject
    file: path/to/anyfile.yml

You can include many files from many different projects.

It is even possible to skip defining a .gitlab-ci.yml file in a particular project altogether by specifying a CI YAML file in another project in the project settings.



Answered By - sytech
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing