I have, in GitLab, a group containing multiple projects and I also have a .gitlab-ci.yml
file that is in one of the projects and that runs each time a change is pushed. However, I would like to be able to run this exact file in any of the projects in my group.
I have read about multi-project pipelines and how a pipeline from another project can trigger other pipelines so that could be a solution. So I was thinking about creating a project at the root of the group that could do this.
However the ideal for me would be to move .gitlab-ci.yml
file to the root of the group, and maybe add a workflow rule that will trigger the pipeline only on push :
workflow: # Only runs on push
rules:
- if: $CI_PIPELINE_SOURCE == 'push'
But I couldn’t find anything like this. What is the optimal solution in my case ?