【问题标题】:does appengine cloudbuild.yaml requires a custom runtime?appengine cloudbuild.yaml 是否需要自定义运行时?
【发布时间】:2018-09-28 12:36:14
【问题描述】:

使用以下输出构建错误(使用 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.

【问题讨论】:

    标签: google-app-engine google-cloud-build


    【解决方案1】:

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

    然后将其从 Autodetected 更改为手动选择您的 Cloud Build configuration file

    更多信息请参见Github issue

    【讨论】:

    • 它可以工作,但没有显示版本。就像没有部署任何东西一样
    【解决方案2】:

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

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

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

    下面是一个例子:

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

    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' 
    

    【讨论】:

    • 这是一个老问题,但是@David 你是否需要让你的 app.yaml “目录感知”?我在部署步骤中遇到奇怪的错误,即找不到 package.json
    • 我在云构建过程中使用 /bin/bash 将 app.yaml 从子目录复制到主目录取得了一些的成功。
    • @stevecowling 我的回答可能会对你有所帮助。
    猜你喜欢
    • 2020-08-14
    • 1970-01-01
    • 2013-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多