pra
pra

Reputation: 363

does appengine cloudbuild.yaml requires a custom runtime?

Build errors out with below output (Using a Rails app)

ERROR: (gcloud.app.deploy) There is a cloudbuild.yaml in the current directory, and the runtime field in /workspace/app.yaml is currently set to [runtime: ruby]. To use your cloudbuild.yaml to build a custom runtime, set the runtime field to [runtime: custom]. To continue using the [ruby] runtime, please remove the cloudbuild.yaml from this directory.

Upvotes: 5

Views: 3526

Answers (2)

Ringil
Ringil

Reputation: 6527

One way to deal with this is to change the name of the cloudbuild.yaml file to say cloud_build.yaml (you can also just move the file) and then go to your triggers in Cloud Build:

enter image description here

And change it from Autodetected to choosing your Cloud Build configuration file manually:

enter image description here

See this Github issue for some more information

Upvotes: 8

David
David

Reputation: 654

Cloudbuild.yaml should work with App Engine Flexible without the need to use a custom runtime. As detailed in the error message, you cannot have the app.yaml and the cloudbuild.yaml in the same directory if you are deploying in a non-custom runtime, to remedy the situation, follow these steps:

  1. Move the app.yaml and other ruby files into a subdirectory (use your original app.yaml, no need to use custom runtime)

  2. Under your cloudbuild.yaml steps, modify the argument for app deploy by adding a third one specifying the app.yaml path.

Below is an example:

==================FROM:

steps: 
- name: 'gcr.io/cloud-builders/gcloud' 
args: ['app', 'deploy'] 
timeout: '1600s' 

===================TO:

steps: 
- name: 'gcr.io/cloud-builders/gcloud' 
args: ['app', 'deploy', '[SUBDIRECTORY/app.yaml]'] 
timeout: '1600s' 

Upvotes: 3

Related Questions