From the course: Continuous Integration and Continuous Delivery with GitLab (2022)
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Automating deployments
From the course: Continuous Integration and Continuous Delivery with GitLab (2022)
Automating deployments
- [Instructor] Now that we've got manual deployments working, we've got the basics of an end-to-end CICD pipeline, but some of the real dynamic power of CICD comes when we add automation to our deployments. To start, let's think about our branching strategy. So far, every change we've made has been committed to the main branch. So let's consider main our main development branch and we'll keep it so that any time a commit is made to main, it'll trigger QA to deploy. So let's open up our pipeline editor and we'll scroll down to our deploy QA job. So we'll replace this manual rule, when manual, with an if and we'll say colon. GitLab provides us with some handy built-in variables that we can use here. One of them is CI commit branch. So I'll say $CI_commitbranch. And that's the branch that the change was committed to. So if we say CI commit branch = = main, then if the branch that generated the commit is the main branch…