I'm working on a project where we're using a similar gitlab-ci.yml file across multiple repositories, with minor adjustments for each project. I need to implement a change across all branches of nearly all projects, but merging or rebasing is going to be too time-consuming. My initial thought was to create a diff file to apply to each branch, but that still feels pretty labor-intensive. Any suggestions or strategies to make this easier would be greatly appreciated!
2 Answers
I would recommend writing a script that checks out each repo and branch, applies the desired changes, commits them, and then switches back to the trunk. That way, you'll minimize the manual work.
One approach I’d take is to create a repository containing template files. Then, you can reference these templates in your projects and branches. While you’ll still have to make adjustments to each branch, this way, you only need to do it once for every change, reducing tech debt in the long run!
That's a solid idea! We do use templates for several jobs, but unfortunately, this particular change isn't in that category. Thanks for the tip!
That sounds like a great solution! I might use that to automate referencing in the future too. Thanks for your help!