Reference documentation and code samples for the Google Cloud Build V1 Client class BuildTrigger.
Configuration for an automated build in response to source repository changes.
Generated from protobuf message google.devtools.cloudbuild.v1.BuildTrigger
Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ resource_name
string
The Trigger
name with format: projects/{project}/locations/{location}/triggers/{trigger}
, where {trigger} is a unique identifier generated by the service.
↳ id
string
Output only. Unique identifier of the trigger.
↳ description
string
Human-readable description of this trigger.
↳ name
string
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.
↳ tags
array
Tags for annotation of a BuildTrigger
↳ trigger_template
Google\Cloud\Build\V1\RepoSource
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
.
↳ github
Google\Cloud\Build\V1\GitHubEventsConfig
GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received. Mutually exclusive with trigger_template
.
↳ pubsub_config
Google\Cloud\Build\V1\PubsubConfig
PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.
↳ webhook_config
Google\Cloud\Build\V1\WebhookConfig
WebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger's webhook URL.
↳ autodetect
bool
Autodetect build configuration. The following precedence is used (case insensitive): 1. cloudbuild.yaml 2. cloudbuild.yml 3. cloudbuild.json 4. Dockerfile Currently only available for GitHub App Triggers.
↳ build
↳ filename
string
Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).
↳ create_time
↳ disabled
bool
If true, the trigger will never automatically execute a build.
↳ substitutions
array| Google\Protobuf\Internal\MapField
Substitutions for Build resource. The keys must match the following regular expression: ^_[A-Z0-9_]+$
.
↳ ignored_files
array
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.
↳ included_files
array
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.
↳ filter
string
Optional. A Common Expression Language string.
↳ service_account
string
The service account used for all user-controlled operations including UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild. If no service account is set, then the standard Cloud Build service account ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. Format: projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}
getResourceName
The Trigger
name with format: projects/{project}/locations/{location}/triggers/{trigger}
, where
{trigger} is a unique identifier generated by the service.
string
setResourceName
The Trigger
name with format: projects/{project}/locations/{location}/triggers/{trigger}
, where
{trigger} is a unique identifier generated by the service.
var
string
$this
getId
Output only. Unique identifier of the trigger.
string
setId
Output only. Unique identifier of the trigger.
var
string
$this
getDescription
Human-readable description of this trigger.
string
setDescription
Human-readable description of this trigger.
var
string
$this
getName
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.
string
setName
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.
var
string
$this
getTags
Tags for annotation of a BuildTrigger
setTags
Tags for annotation of a BuildTrigger
var
string[]
$this
getTriggerTemplate
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
.
hasTriggerTemplate
clearTriggerTemplate
setTriggerTemplate
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
.
$this
getGithub
GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received.
Mutually exclusive with trigger_template
.
hasGithub
clearGithub
setGithub
GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received.
Mutually exclusive with trigger_template
.
$this
getPubsubConfig
PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.
hasPubsubConfig
clearPubsubConfig
setPubsubConfig
PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.
$this
getWebhookConfig
WebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger's webhook URL.
hasWebhookConfig
clearWebhookConfig
setWebhookConfig
WebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger's webhook URL.
$this
getAutodetect
Autodetect build configuration. The following precedence is used (case insensitive):
- cloudbuild.yaml
- cloudbuild.yml
- cloudbuild.json
- Dockerfile Currently only available for GitHub App Triggers.
bool
hasAutodetect
setAutodetect
Autodetect build configuration. The following precedence is used (case insensitive):
- cloudbuild.yaml
- cloudbuild.yml
- cloudbuild.json
- Dockerfile Currently only available for GitHub App Triggers.
var
bool
$this
getBuild
Contents of the build template.
hasBuild
setBuild
Contents of the build template.
$this
getFilename
Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).
string
hasFilename
setFilename
Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).
var
string
$this
getCreateTime
Output only. Time when the trigger was created.
hasCreateTime
clearCreateTime
setCreateTime
Output only. Time when the trigger was created.
$this
getDisabled
If true, the trigger will never automatically execute a build.
bool
setDisabled
If true, the trigger will never automatically execute a build.
var
bool
$this
getSubstitutions
Substitutions for Build resource. The keys must match the following
regular expression: ^_[A-Z0-9_]+$
.
setSubstitutions
Substitutions for Build resource. The keys must match the following
regular expression: ^_[A-Z0-9_]+$
.
$this
getIgnoredFiles
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.
setIgnoredFiles
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.
var
string[]
$this
getIncludedFiles
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.
setIncludedFiles
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.
var
string[]
$this
getFilter
Optional. A Common Expression Language string.
string
setFilter
Optional. A Common Expression Language string.
var
string
$this
getServiceAccount
The service account used for all user-controlled operations including UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild.
If no service account is set, then the standard Cloud Build service account
([PROJECT_NUM]@system.gserviceaccount.com) will be used instead.
Format: projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}
string
setServiceAccount
The service account used for all user-controlled operations including UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild.
If no service account is set, then the standard Cloud Build service account
([PROJECT_NUM]@system.gserviceaccount.com) will be used instead.
Format: projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}
var
string
$this
getBuildTemplate
string