Class Trigger
Configuration for an automated build in response to source repository changes.
To get more information about Trigger, see:
- API documentation
- How-to Guides
- Automating builds using build triggers
Example Usage - Cloudbuild Trigger Filename
using Pulumi;
using Gcp = Pulumi.Gcp;
class MyStack : Stack
{
public MyStack()
{
var filename_trigger = new Gcp.CloudBuild.Trigger("filename-trigger", new Gcp.CloudBuild.TriggerArgs
{
Filename = "cloudbuild.yaml",
Substitutions =
{
{ "_BAZ", "qux" },
{ "_FOO", "bar" },
},
TriggerTemplate = new Gcp.CloudBuild.Inputs.TriggerTriggerTemplateArgs
{
BranchName = "master",
RepoName = "my-repo",
},
});
}
}
Inherited Members
Namespace: Pulumi.Gcp.CloudBuild
Assembly: Pulumi.Gcp.dll
Syntax
public class Trigger : CustomResource
Constructors
View SourceTrigger(String, TriggerArgs, CustomResourceOptions)
Create a Trigger resource with the given unique name, arguments, and options.
Declaration
public Trigger(string name, TriggerArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| TriggerArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceBuild
Contents of the build template. Either a filename or build template must be provided. Structure is documented below.
Declaration
public Output<TriggerBuild> Build { get; }
Property Value
| Type | Description |
|---|---|
| Output<TriggerBuild> |
CreateTime
Time when the trigger was created.
Declaration
public Output<string> CreateTime { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Description
Human-readable description of the trigger.
Declaration
public Output<string> Description { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Disabled
Whether the trigger is disabled or not. If true, the trigger will never result in a build.
Declaration
public Output<bool?> Disabled { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Filename
Path, from the source root, to a file whose contents is used for the template. Either a filename or build template must be provided.
Declaration
public Output<string> Filename { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Github
Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
One of trigger_template or github must be provided. Structure is documented below.
Declaration
public Output<TriggerGithub> Github { get; }
Property Value
| Type | Description |
|---|---|
| Output<TriggerGithub> |
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.
Declaration
public Output<ImmutableArray<string>> IgnoredFiles { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
IncludedFiles
ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match
extended with support for **.
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.
Declaration
public Output<ImmutableArray<string>> IncludedFiles { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Name
Name of the volume to mount. Volume names must be unique per build step and must be valid names for Docker volumes. Each named volume must be used by at least two build steps.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Project
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
Declaration
public Output<string> Project { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Substitutions
Substitutions data for Build resource.
Declaration
public Output<ImmutableDictionary<string, string>> Substitutions { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
TriggerId
The unique identifier for the trigger.
Declaration
public Output<string> TriggerId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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.
One of trigger_template or github must be provided. Structure is documented below.
Declaration
public Output<TriggerTriggerTemplate> TriggerTemplate { get; }
Property Value
| Type | Description |
|---|---|
| Output<TriggerTriggerTemplate> |
Methods
View SourceGet(String, Input<String>, TriggerState, CustomResourceOptions)
Get an existing Trigger resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Trigger Get(string name, Input<string> id, TriggerState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| TriggerState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Trigger |