Skip to content

☁️ Continuous deployment and testing of Google cloud functions with Postman and Cloud Build

Notifications You must be signed in to change notification settings

abhinaba-ghosh/google-cloud-build-postman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-cloud-build-postman

Cloud Functions is an event-driven serverless compute platform. Cloud Functions allows you to write your code without worrying about provisioning resources or scaling to handle changing requirements. This repository provide you a glimpse of

Steps to Deploy and Test

  • Signup to GCP, Its nearly free for a year!
  • Install the gcloud command line tool as per your operating system
  • Clone this repository
  • Install the dependencies
npm i
  • Run the backend locally to check everything works fine
npm start
  • if all runs well, navigate to the browser and open http://localhost:8081/api/portfolio. It should show the json response.

  • Run unit test with command

npm run test:unit
  • Stop the local service and deploy it to the GCP
gcloud beta functions deploy myWebsiteBackend --trigger-http --runtime nodejs10
  • Once the function got deployed you will receive the endpoint printed in the `console. Grab the endpoint

  • Push this as a new repository in your own Github/any-other source code management space.

  • Create a trigger with installing github Could Build App for your repository.

  • Now go to the Cloud Build console and navigate to Trigger section. Create a new trigger of your choice. Just keep in mind to provide a user substitute value with your grabbed url in earlier function deployment stage

trigger

  • Now, trigger the run or push a commit to your repo. You can see the magic happening in the newly triggered build.

log

More

Find more in this Medium Article

Suggestions/PR

Any suggestions/PR top rectify flows is welcome!

About

☁️ Continuous deployment and testing of Google cloud functions with Postman and Cloud Build

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published