Resource: BuildTrigger
Configuration for an automated build in response to source repository changes.
JSON representation |
---|
{ "resourceName": string, "id": string, "description": string, "name": string, "tags": [ string ], "triggerTemplate": { object ( |
Fields | |
---|---|
resourceName |
The |
id |
Output only. Unique identifier of the trigger. |
description |
Human-readable description of this trigger. |
name |
User-assigned name of the trigger. Must be unique within the project. Trigger names must meet the following requirements:
|
tags[] |
Tags for annotation of a |
triggerTemplate |
Template describing the types of source changes to trigger a build. Branch and tag names in trigger templates are interpreted as regular expressions. Any branch or tag change that matches that regular expression will trigger a build. Mutually exclusive with |
github |
GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received. Mutually exclusive with |
pubsubConfig |
PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published. |
webhookConfig |
WebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger's webhook URL. |
bitbucketServerTriggerConfig |
BitbucketServerTriggerConfig describes the configuration of a trigger that creates a build whenever a Bitbucket Server event is received. |
gitlabEnterpriseEventsConfig |
GitLabEnterpriseEventsConfig describes the configuration of a trigger that creates a build whenever a GitLab Enterprise event is received. |
createTime |
Output only. Time when the trigger was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
disabled |
If true, the trigger will never automatically execute a build. |
substitutions |
Substitutions for Build resource. The keys must match the following regular expression: An object containing a list of |
ignoredFiles[] |
ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match extended with support for "**". If ignoredFiles and changed files are both empty, then they are not used to determine whether or not to trigger a build. If ignoredFiles 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 ignoredFiles globs, then we do not trigger a build. |
includedFiles[] |
If any of the files altered in the commit pass the ignoredFiles filter and includedFiles 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 ignoredFiles filter and includedFiles is not empty, then we make sure that at least one of those files matches a includedFiles glob. If not, then we do not trigger a build. |
sourceToBuild |
The repo and ref of the repository from which to build. This field is used only for those triggers that do not respond to SCM events. Triggers that respond to such events build source at whatever commit caused the event. This field is currently only used by Webhook, Pub/Sub, Manual, and Cron triggers. |
approvalConfig |
Configuration for manual approval to start a build invocation of this BuildTrigger. |
filter |
A Common Expression Language string. |
serviceAccount |
The service account used for all user-controlled operations including triggers.patch, triggers.run, builds.create, and builds.cancel. If no service account is set and the legacy Cloud Build service account ([PROJECT_NUM]@cloudbuild.gserviceaccount.com) is the default for the project then it will be used instead. Format: |
eventType |
EventType allows the user to explicitly set the type of event to which this BuildTrigger should respond. This field will be validated against the rest of the configuration if it is set. |
includeBuildLogs |
If set to INCLUDE_BUILD_LOGS_WITH_STATUS, log url will be shown on GitHub page when build status is final. Setting this field to INCLUDE_BUILD_LOGS_WITH_STATUS for non GitHub triggers results in INVALID_ARGUMENT error. |
repositoryEventConfig |
The configuration of a trigger that creates a build whenever an event from Repo API is received. |
Union field build_template . Template describing the Build request to make when the trigger is matched. At least one of the template fields must be provided. build_template can be only one of the following: |
|
autodetect |
Autodetect build configuration. The following precedence is used (case insensitive):
Currently only available for GitHub App Triggers. |
build |
Contents of the build template. |
filename |
Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml). |
gitFileSource |
The file source describing the local or remote Build template. |
Methods |
|
---|---|
|
Creates a new BuildTrigger . |
|
Deletes a BuildTrigger by its project ID and trigger ID. |
|
Returns information about a BuildTrigger . |
|
Lists existing BuildTrigger s. |
|
Updates a BuildTrigger by its project ID and trigger ID. |
|
Runs a BuildTrigger at a particular source revision. |
|
ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger. |