5

使用以下输出构建错误(使用 Rails 应用程序)

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.
4

2 回答 2

8

解决此问题的一种方法是更改cloudbuild.yaml​​文件名cloud_build.yaml(您也可以只移动文件),然后转到 Cloud Build 中的触发器:

在此处输入图像描述

并将其更改为手动Autodetected选择:Cloud Build configuration file

在此处输入图像描述

有关更多信息,请参阅此Github 问题

于 2019-12-28T18:09:24.340 回答
2

Cloudbuild.yaml 应该与 App Engine Flexible 一起使用,而无需使用自定义运行时。如错误消息中所述,如果您在非自定义运行时中部署,则不能将 app.yaml 和 cloudbuild.yaml 放在同一目录中,要纠正这种情况,请按照下列步骤操作:

  1. 将 app.yaml 和其他 ruby​​ 文件移动到子目录中(使用您原来的 app.yaml,无需使用自定义运行时)

  2. 在您的 cloudbuild.yaml 步骤下,通过添加第三个指定 app.yaml 路径的参数来修改 app deploy 的参数。

下面是一个例子:

==================来自:

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' 
于 2018-09-28T15:49:38.430 回答