PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, September 26, 2022

[FIXED] How to auto deploy latest image from Cloud Build in Cloud Run

 September 26, 2022     continuous-deployment, google-cloud-build, google-cloud-platform, google-cloud-run     No comments   

Issue

My CI/CD pipeline for deploying my Angular app is close but I see that Google Cloud Run does not deploy a new revision when the container image has been updated.

I have Cloud Build set to trigger a build when a branch on GitHub has been updated. That is working fine and I see I get a new image named after the commit hash. I'm expecting Cloud Run to trigger its service, pick up the latest image and deploy it but it's not running. I'm not sure if I need to change the image names so they are not unique due to the SHA.

Jeremy


Solution

Add a Cloud Build step to deploy the new image to Cloud Run.

Modify this example with SERVICE_NAME, REGION, PROJECT_ID, and IMAGE.

# Deploy container image to Cloud Run
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
  entrypoint: gcloud
  args: ['run', 'deploy', 'SERVICE-NAME', '--image', 'gcr.io/PROJECT_ID/IMAGE', '--region', 'REGION', '--platform', 'managed']

Documentation



Answered By - John Hanley
Answer Checked By - David Goodson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing