Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Deploy Cloud Run from another Cloud Run CI/CD (Cloud Build & Source Repository) Image

I have two Cloud Run projects based on Ruby on Rails 6

  • gcr-uat
  • gcr-prod

Details of deployments on gcr-uat:

  • All the code committed to source repository
  • Created the project with CI/CD using Cloud Build trigger (Dockerfile)
  • On new commit cloud Build will auto build and deploy
  • Env var set to RAIL_ENV=development
  • On successful deploy two database will be created db_development and db_test.

I want to deploy gcr-prod based on image built from gcr-uat. Env var set to RAIL_ENV=production. during deployment I will choose deploy from other project and select image from other project on Artifact Registry.  All the permission are granted to gcr-prod to use the image from gcr-uat.

On successful deployment by right RoR will create db_production database, but its created db_development and db_test databases.

I need to know any config need to be changed on Ruby on Rails side or how the Cloud Build do the build process, is it same as how docker build. Thank you.

0 1 542
1 REPLY 1

Hi @ershadahamed,

Welcome to Google Cloud Community!

You can refer to this document to see details about Deploying to Cloud Run using Cloud Build and check this page regarding Build container images.

You can also get in touch with Google Cloud Support  to get the right support you need. 

 

Top Solution Authors