appengine cloudbuild.yaml是否需要自定义运行时? [英] does appengine cloudbuild.yaml requires a custom runtime?
问题描述
使用以下输出构建错误(使用Rails应用)
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.
推荐答案
Cloudbuild.yaml可以与App Engine Flexible一起使用,而无需使用自定义运行时.如错误消息中所述,如果要在非定制运行时中进行部署,则不能将app.yaml和cloudbuild.yaml放在同一目录中,以解决这种情况,请执行以下步骤:
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:
-
将app.yaml和其他ruby文件移动到子目录中(使用原始的app.yaml,无需使用自定义运行时)
Move the app.yaml and other ruby files into a subdirectory (use your original app.yaml, no need to use custom runtime)
在您的cloudbuild.yaml步骤下,通过添加指定app.yaml路径的第三个参数来修改用于app deploy的参数.
Under your cloudbuild.yaml steps, modify the argument for app deploy by adding a third one specifying the app.yaml path.
下面是一个示例:
===================从:
==================FROM:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy']
timeout: '1600s'
=================== TO:
===================TO:
steps:
- name: 'gcr.io/cloud-builders/gcloud'
args: ['app', 'deploy', '[SUBDIRECTORY/app.yaml]']
timeout: '1600s'
这篇关于appengine cloudbuild.yaml是否需要自定义运行时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!