Delivering your code to the right environment
Your code is written, verified, and secured. The only step left is to deploy it.
Deploying the code
The final task of our pipeline is to deploy the Hats for Cats code to the right environment. Normally, we’d define separate jobs to deploy code to a review environment, the pre-production environment, or the production environment. Then, we would use GitLab’s rules:
and if:
keywords to control which one of those three jobs should run, depending on which Git branch the pipeline was running on.
To keep things simple in this example, let’s just walk through how to deploy it to the production environment. We’ll imagine that we want this to happen whenever we run the pipeline on the production branch.
As you learned in Chapter 8, there are countless techniques you can use to deploy code. Which technique you choose depends largely on what sort of environment you’re deploying to: an AWS EC2 VM, a Kubernetes...