Skip to content

Commit 4e08083

Browse files
jamielennoxrosbo
authored andcommitted
Allow using in repo configuration for cloudbuild trigger (hashicorp#1557)
* Allow using in repo configuration for cloudbuild trigger Cloudbuild triggers have a complex configuration that can be defined from the API. When using the console, the more typical way of doing this is to defined the configuration within the repository and point the configuration to the file that defines the config. This can be supported by sending the filename parameter instead of the build parameter, however only one can be sent. * Acceptance testing for cloudbuild trigger with filename Ensure that when a cloudbuild repo trigger is created with a filename, that filename is what actually ends up in the cloud. * Don't specify "by default" in cloudbuild-trigger. The docs shouldn't say that "cloudbuild.yaml" is used by default. There is no default from the APIs, but the console suggest using this value. Just say it's the typical value in documentation.
1 parent 33a7d91 commit 4e08083

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

docs/r/cloudbuild_trigger.html.markdown

+19
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ resource "google_cloudbuild_trigger" "build_trigger" {
3333
}
3434
```
3535

36+
OR
37+
38+
```hcl
39+
resource "google_cloudbuild_trigger" "build_trigger" {
40+
project = "my-project"
41+
trigger_template {
42+
branch_name = "master"
43+
project = "my-project"
44+
repo_name = "some-repo"
45+
}
46+
filename = "cloudbuild.yaml"
47+
}
48+
```
49+
50+
3651
## Argument Reference
3752

3853
(Argument descriptions sourced from https://godoc.org/google.golang.org/api/cloudbuild/v1#BuildTrigger)
@@ -59,6 +74,10 @@ will be expanded when the build is created:
5974
or resolved from the specified branch or tag.
6075
* `$SHORT_SHA`: first 7 characters of `$REVISION_ID` or `$COMMIT_SHA`.
6176

77+
* `filename` - (Optional) Specify the path to a Cloud Build configuration file
78+
in the Git repo. This is mutually exclusive with `build`. This is typically
79+
`cloudbuild.yaml` however it can be specified by the user.
80+
6281
---
6382

6483
The `trigger_template` block supports:

0 commit comments

Comments
 (0)