Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Google Cloud

Automated CI/CD Deployment to App Engine with Cloud Build

by Cloudbooklet
3 years ago
in Google Cloud, App Engine
Automated Ci Cd Deployment To App Engine With Cloud Build
ShareTweetSendShare
Readers like you help support Cloudbooklet. When you make a purchase using links on our site, we may earn an affiliate commission.

Automated CI/CD Deployment to App Engine with Cloud Build. In this guide you are going to learn how to setup a CI/CD deployment which deploys the code to App Engine when a push is made to a specific branch in GitHub using Google Cloud Build. Prerequisites A Git repository with your source code. Learn more […]

ADVERTISEMENT

Automated CI/CD Deployment to App Engine with Cloud Build. In this guide you are going to learn how to setup a CI/CD deployment which deploys the code to App Engine when a push is made to a specific branch in GitHub using Google Cloud Build.

Prerequisites

  • A Git repository with your source code. Learn more about Git workflow.
  • A Google Cloud account with billing activated.
  • App Engine application created.

Setup Source Repository in Google Cloud

Go to your Google Cloud console and navigate to Tools >> Source Repository and click on Add repository.

Add A Repository

You can create a new repository or you can connect to an existing repository.

ADVERTISEMENT

If you need to connect to an existing repository you need to choose Connect external repository.

You might also like

How To Setup Ssh Keys On Ubuntu

How to Setup SSH Keys on Ubuntu 20.04

4 months ago
Draggan Ai Editing Tool Install And Use Draggan Photo Editor

DragGAN AI Editing Tool Install and Use DragGAN Photo Editor

4 months ago
Connect External Repository
Automated CI/CD Deployment to App Engine with Cloud Build 1

Choose your project id and your git provider for example GitHub.

Click Connect to GitHub.

ADVERTISEMENT
Connect To Github

Click Authorize Google Cloud Platform.

Now you will see all your repositories in your GCP project page.

ADVERTISEMENT
Select Repository

Click Connect selected repository.

Now you will see your repository added to the Source Repositories in Google cloud.

ADVERTISEMENT

Configure Cloud Build for Automated Deployment

Go to your Google Cloud console and navigate to Tools >> Cloud Build >> Triggers. If you haven’t enabled this API you will be prompted to enable this API.

Click Create Trigger.

ADVERTISEMENT
Create Trigger

Enter Name of trigger.

In Event choose Push to Branch.

In the Source choose the repository you added earlier.

In the Branch enter the branch name for which you wish to trigger the build.

In the Build Configuration choose Cloud Build configuration file.

Enter cloudbuild.yaml.

Configure Cloud Build and App YAML files

Create a new cloudbuild.yaml file in your repository root.

Add the following contents triggering the gcloud app deploy.

steps:
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
  entrypoint: 'bash'
  args: ['-c', 'gcloud config set app/cloud_build_timeout 1600 && gcloud app deploy']
timeout: '1600s'

Create a new app.yaml file in your repository root.

Add the following contents for deployment.

This is an example of deploying a static HTML site.

runtime: nodejs12

handlers:
  - url: /
    static_files: www/index.html
    upload: www/index.html

  - url: /(www/.*)$
    static_files: www/\1.html
    upload: www/.*\.html$

Now your configurations are in place. You can try making changes to your repository. Once a push is made to the specific branch your repository will get synced to Source Repositories and deployed to App Engine.

Conclusion

Now you have learned how to setup automated deployments to App Engine with Cloud Build and GitHub.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: Google Cloud Platform
Share2Tweet1SendShare
Cloudbooklet

Cloudbooklet

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Related Posts

Set Up Deep Learning With Nvidia, Cuda, Cudnn On Ubuntu

How to Set Up Deep Learning with Nvidia, CUDA, cuDNN on Ubuntu 22.04

7 months ago
How To Install Or Upgrade Php 8.2 On Ubuntu 22.04

How to Install or Upgrade PHP 8.2 on Ubuntu 22.04

9 months ago
How To Change Timezone On Ubuntu 22.04

How to Change Timezone on Ubuntu 22.04

1 year ago
How To Install Ansible On Ubuntu 22.04

How to Install Ansible on Ubuntu 22.04

1 year ago

Follow Us

Trending Articles

Delete Netflix Account

How to Delete Netflix Account Permanently

September 21, 2023

HeyGen AI: Free AI Video Generator to Create Amazing Videos

5 FREE AI Horoscope Online – Personalized Way to See Your Future

Create High Quality AI Cover Song with Covers AI

AI Annotation Jobs: Everything You Need to Know

Top 7 Free Dating Sites for Men in 2023

Popular Articles

Charley Ai

Charley AI: The Best AI Essay Writing Tool

September 13, 2023

How to Clear Gmail Inbox with AI: Tips and Tricks

AI Emotion Detector: Detect and Interpret Human Emotions Accurately

6 Best AI Cover Song Generators for Free Online

Jenni AI: How to Use AI Writing Assistant for Amazing Content

How to Use Canva on ChatGPT: A Step-by-Step Guide

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.