Google Cloud Build V1 Client - Class BuildTrigger (0.7.3)

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

Namespace

Google \ Cloud \ Build \ V1

Methods

__construct

Constructor.

Parameters
Name
Description
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
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
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.

Returns
Type
Description
string

setResourceName

The Trigger name with format: projects/{project}/locations/{location}/triggers/{trigger} , where {trigger} is a unique identifier generated by the service.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

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

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

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

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
Returns
Type
Description
$this

getPubsubConfig

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

Returns
Type
Description

hasPubsubConfig

clearPubsubConfig

setPubsubConfig

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

Parameter
Name
Description
Returns
Type
Description
$this

getWebhookConfig

WebhookConfig describes the configuration of a trigger that creates a build whenever a webhook is sent to a trigger's webhook URL.

Returns
Type
Description

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.

Parameter
Name
Description
Returns
Type
Description
$this

getAutodetect

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.
Returns
Type
Description
bool

hasAutodetect

setAutodetect

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.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this

getBuild

Contents of the build template.

Returns
Type
Description

hasBuild

setBuild

Contents of the build template.

Parameter
Name
Description
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

hasCreateTime

clearCreateTime

setCreateTime

Output only. Time when the trigger was created.

Parameter
Name
Description
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

setSubstitutions

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

Parameter
Name
Description
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

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

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

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}

Returns
Type
Description
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}

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getBuildTemplate

Returns
Type
Description
string
Design a Mobile Site
View Site in Mobile | Classic
Share by: