Deploying infrastructure by CI-CD

Mikes Notes

I need a way to automate cloud deployments to handle scaling. I had toyed with the idea of training Pipi to do it. But I read a great article on Medium about using Jenkins with Terraform on GCP.

In that case, Pipi could get the CMS engine to generate the configuration files. Jenkins could execute them, with Terraform deploying open-source PIPI applications from GitHub to GCP and handling any user special requirements. Well, that's a plan (plans do change !).

Hopefully, Pipi can communicate with Jenkins via an API.

GCP-How to deploy your infrastructure with CI/CD pipeline using Terraform?

By Sumit K
Feb 10 2023, Medium


Jenkins is an open-source automation tool for Continuous Integration (CI) and Continuous Deployment (CD). It is a server-based system that runs in servlet containers like Apache Tomcat. Jenkins is one of the most used DevOps and other cloud-native tools, allowing developers to build, test and deploy software seamlessly.


Terraform is an open-source infrastructure as a code software tool that enables you to create, change, and improve infrastructure safely and predictably.

Git is a free and open-source version control system used to handle that handles small to massive projects efficiently. Git tracks changes in the source code, enabling multiple developers to work together on non-linear development.

In this tutorial, We will deploy our infrastructure (VPC and Subnet) with Terraform but with a CI/CD approach. We will basically integrate Terraform into a generic deployment pipeline. Simply put, We are asking Jenkins to perform terraform-related operations on behalf of humans and bring automation to make your life easier. So, you will write a code in your local machine and push these codes to the source repository GitHub. The Jenkins server (which is running in Google Cloud) will fetch this repo, perform automation and deploy your infrastructure in GCP. Refer to the below diagram, and let’s get straight on to the demo.




...

Mikes Notes

The rest of the article gives detailed instructions on how to do this. Jenkins and Terraform will work with and can be hosted on all the major cloud providers.

  • AWS
  • Azure
  • GCP
  • IBM
  • Digital Ocean
They can also be installed locally on 

No comments:

Post a Comment