We recently started to use self-hosted gitlab-ce and have created our first pipeline to build and deploy some docker-contaners.
As we have a monorepository with lots of dependent subprojects and this pipeline should be triggered only on changes in spicific path in master we have addded appropriate lines to gitlab-ci.yml:
So we thought pipeline should be triggered only if changes were made to trunk/source/Garnet/**/* and only in master.
But it’s trigger on any feature branch or every merge request on master even if those changes are not related to that specific project. And it’s always fails becasue we have configured “needs” to speed-up (running manually goes fine).
according to gitlab pipeline configuration reference, they higlighted as invalid yaml because of “needs” directive in jobs config, so this is normal behaviour. But we want the pipeline to not be triggered by those branches at all.
We have tried to add “except” rules, so now it looks like:
Is it possible that you’re updating the .gitlab-ci.yml on the master branch and not on the other branches? If that’s the case all those other branches still have the outdated ci file and that’s why they’re still being run.
What I would suggest is creating a new branch (from master I guess), update the .gitlab-ci.yml accordingly and then merge that branch to all other branches.