Issue with .gitlab-ci.yml

Hello.
I faced some issues with .gitlab-ci.yml.
I have three branches and .gitlab-ci.ym file with different configurations in each branch.
When I try to merge develop branch to qa, it’s overwriting .gitlab-ci.yml from qa by file from dev. As a result, I receive failed CI/CD process.
How can I avoid it?

Hey, dagora, your question is extremely vague. I’ve found the best chance of getting help is providing yml fragments, logs, etc, so that people can provide a response rather than having to rewrite the manpages for the asker.

For instance, by design the CI/CD system uses the .gitlab-ci.yml from the branch a pipeline is running. Is that perhaps what you perceive as “overwriting”?

@dagora

that’s expected, because you track .gitlab-ci.yml in Git. Solution is to maintain a single version of .gitlab-ci.yml across all branches and using rules to define which jobs are executed for which branch.

1 Like