top of page

DevOps - CI/CD Set up on GCP

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Jul 2, 2022
  • 1 min read

How To Set Up CI/CD Pipeline on GCP.


Assumption:

GCP Free tier account

ssh key is registered with google cloud.

1.Please login to your GCP account, goto IAM & permission, locate cloudbuild.service account from the list, click edit option, assign Kubernetes Engine Developer role to service account cloudbuild.gserviceaccount.com.


ree

2. Goto Kubernete Engine, click on cluster->create standard cluster with default node pool as 2.

ree

3. Goto cloud source repository ->add new repository->create new repository application-demo.


ree
ree

ree

Open cloud shell, copy git clone command from above screenshot and create empty repository.


Goto your empty repository – cd application-demo

Git checkout -b develop


4. Upload source code with required files ( this source code is available at )


mv cloudbuild.yaml Dockerfile kubernetes.yaml.tpl kubernetes_first_app.py requirements.txt application-demo

git add Dockerfile cloudbuild.yaml kubernetes.yaml.tpl kubernetes_first_app.py requirements.txt

5. Add your email ids

git config --global user.email "you@example.com"

git config --global user.name "Your Name"


6. git commit -m "adding source code files"

git push origin develop


ree

7. create source code repository for env (application-demo-env) as above and follow the same step as above.


Please see below screenshot.


ree

8. Create build trigger on both the repository for your develop branch

goto cloud build-triggers->manage repository->select your repo each like application-demo & application-demo-env and add trigger.


ree



ree



ree

9. Please make changes to code as below,

ree

commit changes ,push it to branch -develop.

This should trigger build and deploy the application to gke cluster.



 
 
 

Recent Posts

See All

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page