Google Cloud Build V1 Client - Class BuildTrigger (0.4.0)

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
NameDescription
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 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

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: ^_[A-Z0-9_]+$.

↳ 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
TypeDescription
string

setId

Output only. Unique identifier of the trigger.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDescription

Human-readable description of this trigger.

Returns
TypeDescription
string

setDescription

Human-readable description of this trigger.

Parameter
NameDescription
var string
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string
Returns
TypeDescription
$this

getTags

Tags for annotation of a BuildTrigger

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setTags

Tags for annotation of a BuildTrigger

Parameter
NameDescription
var string[]
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Cloud\Build\V1\RepoSource
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var Google\Cloud\Build\V1\GitHubEventsConfig
Returns
TypeDescription
$this

getPubsubConfig

Optional. PubsubConfig describes the configuration of a trigger that creates a build whenever a Pub/Sub message is published.

Returns
TypeDescription
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
NameDescription
var Google\Cloud\Build\V1\PubsubConfig
Returns
TypeDescription
$this

getBuild

Contents of the build template.

Returns
TypeDescription
Google\Cloud\Build\V1\Build|null

hasBuild

setBuild

Contents of the build template.

Parameter
NameDescription
var Google\Cloud\Build\V1\Build
Returns
TypeDescription
$this

getFilename

Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).

Returns
TypeDescription
string

hasFilename

setFilename

Path, from the source root, to the build configuration file (i.e. cloudbuild.yaml).

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getCreateTime

Output only. Time when the trigger was created.

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. Time when the trigger was created.

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getDisabled

If true, the trigger will never automatically execute a build.

Returns
TypeDescription
bool

setDisabled

If true, the trigger will never automatically execute a build.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getSubstitutions

Substitutions for Build resource. The keys must match the following regular expression: ^_[A-Z0-9_]+$.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setSubstitutions

Substitutions for Build resource. The keys must match the following regular expression: ^_[A-Z0-9_]+$.

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string[]
Returns
TypeDescription
$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
TypeDescription
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
NameDescription
var string[]
Returns
TypeDescription
$this

getFilter

Optional. A Common Expression Language string.

Returns
TypeDescription
string

setFilter

Optional. A Common Expression Language string.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getBuildTemplate

Returns
TypeDescription
string