小编SUN*_*AVA的帖子

在GCP中,通过Cloudbuild如何确保仅触发文件中发生更改的那些步骤

我的问题是,给定下面的 yaml 文件,如果我在“dir: process/cbd-bu-data”的任何文件中进行更改,Cloud Build 会在触发时串行运行所有步骤。这会导致时间的浪费。

我希望只有该步骤在 cloudbuild 中运行,并在该目录的文件中进行了更改。我应该怎么做才能实现这个目标?

这是我的cloudbuild.yaml文件:

steps: 
  - args: 
      - beta
      - functions
      - deploy
      - "--runtime=python37"
      - "--trigger-http"
      - "--entry-point=process_cbd_group_data"
      - process_cbd_group_data
      - "--region=us-central1"
    dir: process/cbd-group-data
    name: gcr.io/cloud-builders/gcloud
  - args: 
      - beta
      - functions
      - deploy
      - "--runtime=python37"
      - "--trigger-http"
      - "--entry-point=process_cbd_bu_data"
      - process_cbd_bu_data
      - "--region=us-central1"
    dir: process/cbd-bu-data
    name: gcr.io/cloud-builders/gcloud
  - args: 
      - beta
      - functions
      - deploy
      - "--runtime=python37"
      - "--trigger-http"
      - "--entry-point=process_cbd_structure_data"
      - process_cbd_structure_data
      - "--region=us-central1"
    dir: process/cbd-structure-data
    name: gcr.io/cloud-builders/gcloud  
Run Code Online (Sandbox Code Playgroud)

google-cloud-platform google-cloud-functions google-cloud-build

10
推荐指数
2
解决办法
5226
查看次数