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.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ 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 |
string[]
Tags for annotation of a |
↳ 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 |
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 |
↳ pubsub_config |
Google\Cloud\Build\V1\PubsubConfig
Optional. PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published. |
↳ build |
Google\Cloud\Build\V1\Build
Contents of the build template. |
↳ filename |
string
Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml). |
↳ create_time |
Google\Protobuf\Timestamp
Output only. Time when the trigger was created. |
↳ 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: |
↳ ignored_files |
string[]
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 |
string[]
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. |
getId
Output only. Unique identifier of the trigger.
Returns | |
---|---|
Type | Description |
string |
setId
Output only. Unique identifier of the trigger.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getDescription
Human-readable description of this trigger.
Returns | |
---|---|
Type | Description |
string |
setDescription
Human-readable description of this trigger.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$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.
Returns | |
---|---|
Type | Description |
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.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getTags
Tags for annotation of a BuildTrigger
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setTags
Tags for annotation of a BuildTrigger
Parameter | |
---|---|
Name | Description |
var |
string[]
|
Returns | |
---|---|
Type | Description |
$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
.
Returns | |
---|---|
Type | Description |
Google\Cloud\Build\V1\RepoSource|null |
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
.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Build\V1\RepoSource
|
Returns | |
---|---|
Type | Description |
$this |
getGithub
GitHubEventsConfig describes the configuration of a trigger that creates a build whenever a GitHub event is received.
Mutually exclusive with trigger_template
.
Returns | |
---|---|
Type | Description |
Google\Cloud\Build\V1\GitHubEventsConfig|null |
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
.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Build\V1\GitHubEventsConfig
|
Returns | |
---|---|
Type | Description |
$this |
getPubsubConfig
Optional. PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.
Returns | |
---|---|
Type | Description |
Google\Cloud\Build\V1\PubsubConfig|null |
hasPubsubConfig
clearPubsubConfig
setPubsubConfig
Optional. PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Build\V1\PubsubConfig
|
Returns | |
---|---|
Type | Description |
$this |
getBuild
Contents of the build template.
Returns | |
---|---|
Type | Description |
Google\Cloud\Build\V1\Build|null |
hasBuild
setBuild
Contents of the build template.
Parameter | |
---|---|
Name | Description |
var |
Google\Cloud\Build\V1\Build
|
Returns | |
---|---|
Type | Description |
$this |
getFilename
Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).
Returns | |
---|---|
Type | Description |
string |
hasFilename
setFilename
Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getCreateTime
Output only. Time when the trigger was created.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Timestamp|null |
hasCreateTime
clearCreateTime
setCreateTime
Output only. Time when the trigger was created.
Parameter | |
---|---|
Name | Description |
var |
Google\Protobuf\Timestamp
|
Returns | |
---|---|
Type | Description |
$this |
getDisabled
If true, the trigger will never automatically execute a build.
Returns | |
---|---|
Type | Description |
bool |
setDisabled
If true, the trigger will never automatically execute a build.
Parameter | |
---|---|
Name | Description |
var |
bool
|
Returns | |
---|---|
Type | Description |
$this |
getSubstitutions
Substitutions for Build resource. The keys must match the following
regular expression: ^_[A-Z0-9_]+$
.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\MapField |
setSubstitutions
Substitutions for Build resource. The keys must match the following
regular expression: ^_[A-Z0-9_]+$
.
Parameter | |
---|---|
Name | Description |
var |
array|Google\Protobuf\Internal\MapField
|
Returns | |
---|---|
Type | Description |
$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.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
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.
Parameter | |
---|---|
Name | Description |
var |
string[]
|
Returns | |
---|---|
Type | Description |
$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.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
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.
Parameter | |
---|---|
Name | Description |
var |
string[]
|
Returns | |
---|---|
Type | Description |
$this |
getFilter
Optional. A Common Expression Language string.
Returns | |
---|---|
Type | Description |
string |
setFilter
Optional. A Common Expression Language string.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getBuildTemplate
Returns | |
---|---|
Type | Description |
string |