Skip to content

Commit

Permalink
Allow using in repo configuration for cloudbuild trigger (hashicorp#1557
Browse files Browse the repository at this point in the history
)

* 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.
  • Loading branch information
jamielennox authored and rosbo committed Jun 5, 2018
1 parent 33a7d91 commit 4e08083
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/r/cloudbuild_trigger.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ resource "google_cloudbuild_trigger" "build_trigger" {
}
```

OR

```hcl
resource "google_cloudbuild_trigger" "build_trigger" {
project = "my-project"
trigger_template {
branch_name = "master"
project = "my-project"
repo_name = "some-repo"
}
filename = "cloudbuild.yaml"
}
```


## Argument Reference

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

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

---

The `trigger_template` block supports:
Expand Down

0 comments on commit 4e08083

Please sign in to comment.