Updates a BuildTrigger by its project ID and trigger ID. This API is experimental.

Scopes

You will need authorization for the https://www.googleapis.com/auth/cloud-platform scope to make a valid call.

If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform. You can set the scope for this method like this: cloudbuild1 --scope <scope> projects triggers-patch ...

Required Scalar Arguments

  • <project-id> (string)
    • Required. ID of the project that owns the trigger.
  • <trigger-id> (string)
    • Required. ID of the BuildTrigger to update.

Required Request Value

The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.

For example, a structure like this:

BuildTrigger:
  build:
    artifacts:
      images: [string]
      objects:
        location: string
        paths: [string]
        timing:
          end-time: string
          start-time: string
    build-trigger-id: string
    create-time: string
    finish-time: string
    id: string
    images: [string]
    log-url: string
    logs-bucket: string
    name: string
    options:
      disk-size-gb: string
      dynamic-substitutions: boolean
      env: [string]
      log-streaming-option: string
      logging: string
      machine-type: string
      requested-verify-option: string
      secret-env: [string]
      source-provenance-hash: [string]
      substitution-option: string
      worker-pool: string
    project-id: string
    queue-ttl: string
    results:
      artifact-manifest: string
      artifact-timing:
        end-time: string
        start-time: string
      build-step-images: [string]
      build-step-outputs: [string]
      num-artifacts: string
    service-account: string
    source:
      repo-source:
        branch-name: string
        commit-sha: string
        dir: string
        invert-regex: boolean
        project-id: string
        repo-name: string
        substitutions: { string: string }
        tag-name: string
      storage-source:
        bucket: string
        generation: string
        object: string
      storage-source-manifest:
        bucket: string
        generation: string
        object: string
    source-provenance:
      resolved-repo-source:
        branch-name: string
        commit-sha: string
        dir: string
        invert-regex: boolean
        project-id: string
        repo-name: string
        substitutions: { string: string }
        tag-name: string
      resolved-storage-source:
        bucket: string
        generation: string
        object: string
      resolved-storage-source-manifest:
        bucket: string
        generation: string
        object: string
    start-time: string
    status: string
    status-detail: string
    substitutions: { string: string }
    tags: [string]
    timeout: string
  create-time: string
  description: string
  disabled: boolean
  filename: string
  github:
    installation-id: string
    name: string
    owner: string
    pull-request:
      branch: string
      comment-control: string
      invert-regex: boolean
    push:
      branch: string
      invert-regex: boolean
      tag: string
  id: string
  ignored-files: [string]
  included-files: [string]
  name: string
  substitutions: { string: string }
  tags: [string]
  trigger-template:
    branch-name: string
    commit-sha: string
    dir: string
    invert-regex: boolean
    project-id: string
    repo-name: string
    substitutions: { string: string }
    tag-name: string

can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.

  • -r .build.artifacts images=sit
    • A list of images to be pushed upon the successful completion of all build steps. The images will be pushed using the builder service account's credentials. The digests of the pushed images will be stored in the Build resource's results field. If any of the images fail to be pushed, the build is marked FAILURE.
    • Each invocation of this argument appends the given value to the array.
  • objects location=vero
    • Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/". (see Bucket Name Requirements). Files in the workspace matching any path pattern will be uploaded to Cloud Storage with this location as a prefix.
  • paths=rebum.
    • Path globs used to match files in the build's workspace.
    • Each invocation of this argument appends the given value to the array.
  • timing end-time=dolores
    • End of time span.
  • start-time=consetetur

    • Start of time span.
  • .... build-trigger-id=dolores

    • Output only. The ID of the BuildTrigger that triggered this build, if it was triggered automatically.
  • create-time=sed
    • Output only. Time at which the request to create the build was received.
  • finish-time=invidunt
    • Output only. Time at which execution of the build was finished. The difference between finish_time and start_time is the duration of the build's execution.
  • id=clita
    • Output only. Unique identifier of the build.
  • images=dolor
    • A list of images to be pushed upon the successful completion of all build steps. The images are pushed using the builder service account's credentials. The digests of the pushed images will be stored in the Build resource's results field. If any of the images fail to be pushed, the build status is marked FAILURE.
    • Each invocation of this argument appends the given value to the array.
  • log-url=aliquyam
    • Output only. URL to logs for this build in Google Cloud Console.
  • logs-bucket=magna
    • Google Cloud Storage bucket where logs should be written (see Bucket Name Requirements). Logs file names will be of the format ${logs_bucket}/log-${build_id}.txt.
  • name=diam
    • Output only. The 'Build' name with format: projects/{project}/locations/{location}/builds/{build}, where {build} is a unique identifier generated by the service.
  • options disk-size-gb=nonumy
    • Requested disk size for the VM that runs the build. Note that this is NOT "disk free"; some of the space will be used by the operating system and build utilities. Also note that this is the minimum disk size that will be allocated for the build -- the build may run with a larger disk than requested. At present, the maximum disk size is 1000GB; builds that request more than the maximum are rejected with an error.
  • dynamic-substitutions=true
    • Option to specify whether or not to apply bash style string operations to the substitutions. NOTE: this is always enabled for triggered builds and cannot be overridden in the build configuration file.
  • env=sed
    • A list of global environment variable definitions that will exist for all build steps in this build. If a variable is defined in both globally and in a build step, the variable will use the build step value. The elements are of the form "KEY=VALUE" for the environment variable "KEY" being given the value "VALUE".
    • Each invocation of this argument appends the given value to the array.
  • log-streaming-option=est
    • Option to define build log streaming behavior to Google Cloud Storage.
  • logging=takimata
    • Option to specify the logging mode, which determines if and where build logs are stored.
  • machine-type=dolor
    • Compute Engine machine type on which to run the build.
  • requested-verify-option=diam
    • Requested verifiability options.
  • secret-env=at
    • A list of global environment variables, which are encrypted using a Cloud Key Management Service crypto key. These values must be specified in the build's Secret. These variables will be available to all build steps in this build.
    • Each invocation of this argument appends the given value to the array.
  • source-provenance-hash=erat
    • Requested hash for SourceProvenance.
    • Each invocation of this argument appends the given value to the array.
  • substitution-option=justo
    • Option to specify behavior when there is an error in the substitution checks. NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot be overridden in the build configuration file.
  • worker-pool=ipsum

    • Option to specify a WorkerPool for the build. Format: projects/{project}/locations/{location}/workerPools/{workerPool} This field is in beta and is available only to restricted users.
  • .. project-id=accusam

    • Output only. ID of the project.
  • queue-ttl=dolores
    • TTL in queue for this build. If provided and the build is enqueued longer than this value, the build will expire and the build status will be EXPIRED. The TTL starts ticking from create_time.
  • results artifact-manifest=consetetur
    • Path to the artifact manifest. Only populated when artifacts are uploaded.
  • artifact-timing end-time=no
    • End of time span.
  • start-time=justo

    • Start of time span.
  • .. build-step-images=sadipscing

    • List of build step digests, in the order corresponding to build step indices.
    • Each invocation of this argument appends the given value to the array.
  • build-step-outputs=diam
    • List of build step outputs, produced by builder images, in the order corresponding to build step indices. Cloud Builders can produce this output by writing to $BUILDER_OUTPUT/output. Only the first 4KB of data is stored.
    • Each invocation of this argument appends the given value to the array.
  • num-artifacts=sea

    • Number of artifacts uploaded. Only populated when artifacts are uploaded.
  • .. service-account=ipsum

    • IAM service account whose credentials will be used at build runtime. Must be of the format projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}. ACCOUNT can be email address or uniqueId of the service account. This field is in beta.
  • source.repo-source branch-name=stet
    • Regex matching branches to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax
  • commit-sha=gubergren
    • Explicit commit SHA to build.
  • dir=ipsum
    • Directory, relative to the source root, in which to run the build. This must be a relative path. If a step's dir is specified and is an absolute path, this value is ignored for that step's execution.
  • invert-regex=true
    • Only trigger a build if the revision regex does NOT match the revision regex.
  • project-id=sit
    • ID of the project that owns the Cloud Source Repository. If omitted, the project ID requesting the build is assumed.
  • repo-name=kasd
    • Name of the Cloud Source Repository.
  • substitutions=key=amet
    • Substitutions to use in a triggered build. Should only be used with RunBuildTrigger
    • the value will be associated with the given key
  • tag-name=lorem

    • Regex matching tags to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax
  • ..storage-source bucket=justo

  • generation=invidunt
    • Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used.
  • object=sed

    • Google Cloud Storage object containing the source. This object must be a gzipped archive file (.tar.gz) containing source to build.
  • ..storage-source-manifest bucket=nonumy

  • generation=sea
    • Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used.
  • object=ipsum

    • Google Cloud Storage object containing the source manifest. This object must be a JSON file.
  • ...source-provenance.resolved-repo-source branch-name=kasd

    • Regex matching branches to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax
  • commit-sha=justo
    • Explicit commit SHA to build.
  • dir=ea
    • Directory, relative to the source root, in which to run the build. This must be a relative path. If a step's dir is specified and is an absolute path, this value is ignored for that step's execution.
  • invert-regex=false
    • Only trigger a build if the revision regex does NOT match the revision regex.
  • project-id=erat
    • ID of the project that owns the Cloud Source Repository. If omitted, the project ID requesting the build is assumed.
  • repo-name=clita
    • Name of the Cloud Source Repository.
  • substitutions=key=vero
    • Substitutions to use in a triggered build. Should only be used with RunBuildTrigger
    • the value will be associated with the given key
  • tag-name=invidunt

    • Regex matching tags to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax
  • ..resolved-storage-source bucket=nonumy

  • generation=erat
    • Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used.
  • object=erat

    • Google Cloud Storage object containing the source. This object must be a gzipped archive file (.tar.gz) containing source to build.
  • ..resolved-storage-source-manifest bucket=dolores

  • generation=ipsum
    • Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used.
  • object=voluptua.

    • Google Cloud Storage object containing the source manifest. This object must be a JSON file.
  • ... start-time=eos

    • Output only. Time at which execution of the build was started.
  • status=duo
    • Output only. Status of the build.
  • status-detail=elitr
    • Output only. Customer-readable message about the current status.
  • substitutions=key=consetetur
    • Substitutions data for Build resource.
    • the value will be associated with the given key
  • tags=et
    • Tags for annotation of a Build. These are not docker tags.
    • Each invocation of this argument appends the given value to the array.
  • timeout=clita

    • Amount of time that this build should be allowed to run, to second granularity. If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT. timeout starts ticking from startTime. Default time is ten minutes.
  • .. create-time=sit

    • Output only. Time when the trigger was created.
  • description=takimata
    • Human-readable description of this trigger.
  • disabled=true
    • If true, the trigger will never automatically execute a build.
  • filename=nonumy
    • Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).
  • github installation-id=lorem
    • The installationID that emits the GitHub event.
  • name=at
    • Name of the repository. For example: The name for https://github.com/googlecloudplatform/cloud-builders is "cloud-builders".
  • owner=diam
    • Owner of the repository. For example: The owner for https://github.com/googlecloudplatform/cloud-builders is "googlecloudplatform".
  • pull-request branch=diam
    • Regex of branches to match. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax
  • comment-control=sed
    • Configure builds to run whether a repository owner or collaborator need to comment /gcbrun.
  • invert-regex=false

    • If true, branches that do NOT match the git_ref will trigger a build.
  • ..push branch=ipsum

    • Regexes matching branches to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax
  • invert-regex=true
    • When true, only trigger a build if the revision regex does NOT match the git_ref regex.
  • tag=at

    • Regexes matching tags to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax
  • ... id=sit

    • Output only. Unique identifier of the trigger.
  • ignored-files=sit
    • ignored_files and included_files are file glob matches using https://golang.org/pkg/path/filepath/#Match extended with support for "**". If ignored_files and changed files are both empty, then they are not used to determine whether or not to trigger a build. If ignored_files is not empty, then we ignore any files that match any of the ignored_file globs. If the change has no files that are outside of the ignored_files globs, then we do not trigger a build.
    • Each invocation of this argument appends the given value to the array.
  • included-files=lorem
    • If any of the files altered in the commit pass the ignored_files filter and included_files is empty, then as far as this filter is concerned, we should trigger the build. If any of the files altered in the commit pass the ignored_files filter and included_files is not empty, then we make sure that at least one of those files matches a included_files glob. If not, then we do not trigger a build.
    • Each invocation of this argument appends the given value to the array.
  • name=stet
    • User-assigned name of the trigger. Must be unique within the project. Trigger names must meet the following requirements: + They must contain only alphanumeric characters and dashes. + They can be 1-64 characters long. + They must begin and end with an alphanumeric character.
  • substitutions=key=duo
    • Substitutions for Build resource. The keys must match the following regular expression: ^_[A-Z0-9_]+$.
    • the value will be associated with the given key
  • tags=elitr
    • Tags for annotation of a BuildTrigger
    • Each invocation of this argument appends the given value to the array.
  • trigger-template branch-name=aliquyam
    • Regex matching branches to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax
  • commit-sha=erat
    • Explicit commit SHA to build.
  • dir=ut
    • Directory, relative to the source root, in which to run the build. This must be a relative path. If a step's dir is specified and is an absolute path, this value is ignored for that step's execution.
  • invert-regex=true
    • Only trigger a build if the revision regex does NOT match the revision regex.
  • project-id=rebum.
    • ID of the project that owns the Cloud Source Repository. If omitted, the project ID requesting the build is assumed.
  • repo-name=et
    • Name of the Cloud Source Repository.
  • substitutions=key=sed
    • Substitutions to use in a triggered build. Should only be used with RunBuildTrigger
    • the value will be associated with the given key
  • tag-name=stet
    • Regex matching tags to build. The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax

About Cursors

The cursor position is key to comfortably set complex nested structures. The following rules apply:

  • The cursor position is always set relative to the current one, unless the field name starts with the . character. Fields can be nested such as in -r f.s.o .
  • The cursor position is set relative to the top-level structure if it starts with ., e.g. -r .s.s
  • You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify -r struct.sub_struct=bar.
  • You can move the cursor one level up by using ... Each additional . moves it up one additional level. E.g. ... would go three levels up.

Optional Output Flags

The method's return value a JSON encoded structure, which will be written to standard output by default.

  • -o out
    • out specifies the destination to which to write the server's result to. It will be a JSON-encoded structure. The destination may be - to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.

Optional General Properties

The following properties can configure any call, and are not specific to this method.

  • -p $-xgafv=string

    • V1 error format.
  • -p access-token=string

    • OAuth access token.
  • -p alt=string

    • Data format for response.
  • -p callback=string

    • JSONP
  • -p fields=string

    • Selector specifying which fields to include in a partial response.
  • -p key=string

    • API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
  • -p oauth-token=string

    • OAuth 2.0 token for the current user.
  • -p pretty-print=boolean

    • Returns response with indentations and line breaks.
  • -p quota-user=string

    • Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
  • -p upload-type=string

    • Legacy upload protocol for media (e.g. "media", "multipart").
  • -p upload-protocol=string

    • Upload protocol for media (e.g. "raw", "multipart").