Make AutoDevOps more widely applicable by adding CI_PRODUCTION_BRANCH env var
Proposal
The MR !53280 (merged) changed hard-coded master
branches in the AutoDevOps templates to the pre-defined $CI_DEFAULT_BRANCH
variable (also proposed in #320796 (closed)).
This is useful to anyone who has named their master
branch main
, or similar, and it clearly works well for projects using trunk development.
However, for projects that have a staging branch as their default branch, and who use master
, main
, etc. for their production deployment only, the change in !53280 (merged) will mean that affected templates will stop working on their master
branch (or equivalent) and instead work on develop
(or equivalent).
A more general solution, would be to allow each project to configure both a default branch and a default "production" branch in the UI, which may be different or identical, and then make both branches available as CI variables CI_DEFAULT_BRANCH
and CI_PRODUCTION_BRANCH
. That way, any project that separates out the two branches can still use the templates in the expected way.
This has been discussed in 204646#note_355533427 and 204646#note_518732123