chapter seven
7 CI/CD Pipelines as Code
This chapter covers:
- Designing an end-to-end CI/CD pipeline for Docker containers on GCP
- Dividing infrastructure into static and dynamic components
- Iterating over complex types with for-each and dynamic blocks
- Explicitly overriding default providers at the resource level
- Creating custom resources with local-exec provisioners and the Shell provider
CI/CD stands for Continuous Integration (CI) and Continuous Deployment (CD). It’s a methodology that enables development teams to quickly ship code changes to production environments. Companies that adopt CI/CD are proven to be more agile, and able to respond to changes in the marketplace more swiftly, than companies that don’t adopt CI/CD. CI/CD is typically implemented by a CI/CD pipeline, which describes how code gets from version control systems through to end users and customers. In a CI/CD pipeline, each stage performs some discreet task, such as building, testing, and deploying, before automatically promoting to the next stage in the pipeline (see figure 7.1).
Figure 7.1 CI/CD stands for Continuous Integration (CI) and Continuous Deployment (CD). It’s normally implemented by a CI/CD pipeline, in which one stage automatically promotes into the next