【发布时间】:2019-07-02 12:57:06
【问题描述】:
我在挣扎。我找不到这个问题的解决方案。
我想设置一个 CloudBuild 配置文件 'cloudbuild-preprod.yaml' 来部署应用程序,然后每次我与 git 上的特定分支合并时部署 cron 作业。
部署工作正常。但是当我想添加第二个作业来自动部署 cron 作业时。 GCP 抛出错误。
这是我的 cloudbuild 文件 'cloudbuild-preprod.yaml'
steps:
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy", 'app/compa-api-notifications-preprod.yaml']
- name: "gcr.io/cloud-builders/gcloud"
args: ["app", "deploy", 'app/cron-preprod.yaml']
timeout: '1200s'
这是我的 cron 配置文件“cron-preprod.yaml”:
cron:
- description: "monthly summary estimations"
url: /v1/sendMailEstimationsReminders
schedule: 1 of month 09:00
retry_parameters:
job_retry_limit: 1
最后这是我的配置文件“compa-api-notifications-preprod.yaml”(没有 cron 作业也可以正常工作)。
env: flex
runtime: nodejs
service: compa-notifications
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
触发后,第一个作业正常,但第二个作业抛出错误:
ERROR: build step 1 "gcr.io/cloud-builders/gcloud" failed: exit status 1
ERROR
Finished Step #1
Step #1: in "/workspace/app/cron-preprod.yaml", line 2, column 1
Step #1: Unexpected attribute 'cron' for object of type AppInfoExternal.
Step #1: ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/workspace/app/cron-preprod.yaml]
Step #1: Already have image (with digest): gcr.io/cloud-builders/gcloud
Starting Step #1
任何帮助将不胜感激!提前谢谢你
【问题讨论】:
标签: google-cloud-platform cron continuous-integration google-cloud-build