Deploying serverless GCP Cloud Function via Bitbucket Pipelines

Google Cloud Function and Bitbucket
CI/CD workflow

Prerequisite

Steps

Enabling Bitbucket Pipelines
Service Account Permissions
Bitbucket Pipelines repository variables
# Option 1: Read in the file and base64 encode itmore ~/Downloads/keyfile.json | base64
# Option 2: Supply the filename directly to base64 command
base64 ~/Downloads/keyfile.json
Folder / files structure
Cloud Function Python template (main.py)
Sample bitbucket-pipelines.yml
Successful pipeline
Function get deployed to GCP
Test the function on GCP console

Conclusion

Co-founder of Interviewer.AI. GCP Professional Cloud Architect. Passionate about architecting and implementing cloud native solution to make human efficient!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store