Skip to content

Latest commit

 

History

History
63 lines (39 loc) · 2.33 KB

File metadata and controls

63 lines (39 loc) · 2.33 KB

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!