Continuous Delivery with Google App Engine

Create a new Github repo

Create a project in GCP UI

Setup GAE API (just activate), Permissions (go to IAM and add it) and Cloud Build as well

activate cloud-shell and add ssh-keys if not already added to Github: i.e. type ssh-keygen -t rsa than upload key to Github ssh settings

Create an initial project scaffold.
app.yaml, main.py, main_test.py and requirements.txt

Finally, run describe using the gcloud command-line to verify the project is working.

if not, do this to switch:

Next, create an app engine app in the Cloud:

Now create and source the virtual environment.

Now install packages

Now, run flask locally.

Finally deploy it

To automate deployment, create the cloudbuild.yaml file and push it to main:

The on Google cloud search for ‘cloud build’, enable the following GCP Services in settings:

Then go to triggers, create a new trigger, connect it to the repo and select the ‘push to branch’ event.
Now it will auto deploy on every push, just test it with a commit.

Leave a comment

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