Merge pull request #2102 from nownabe/missing-cloudbuild-doc

Update google_cloudbuild_trigger documentation
This commit is contained in:
Paddy 2018-09-26 11:07:40 -07:00 committed by GitHub
commit 33d900537d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,11 +54,6 @@ resource "google_cloudbuild_trigger" "build_trigger" {
The following arguments are supported: The following arguments are supported:
* `description` - (Optional) A brief description of this resource.
* `trigger_template` - (Optional) Location of the source in a Google
Cloud Source Repository. Structure is documented below.
* `build` - (Optional) A build resource in the Container Builder API. * `build` - (Optional) A build resource in the Container Builder API.
Structure is documented below. At a high Structure is documented below. At a high
level, a `build` describes where to find source code, how to build it (for level, a `build` describes where to find source code, how to build it (for
@ -74,14 +69,19 @@ will be expanded when the build is created:
or resolved from the specified branch or tag. or resolved from the specified branch or tag.
* `$SHORT_SHA`: first 7 characters of `$REVISION_ID` or `$COMMIT_SHA`. * `$SHORT_SHA`: first 7 characters of `$REVISION_ID` or `$COMMIT_SHA`.
* `description` - (Optional) A brief description of this resource.
* `filename` - (Optional) Specify the path to a Cloud Build configuration file * `filename` - (Optional) Specify the path to a Cloud Build configuration file
in the Git repo. This is mutually exclusive with `build`. This is typically in the Git repo. This is mutually exclusive with `build`. This is typically
`cloudbuild.yaml` however it can be specified by the user. `cloudbuild.yaml` however it can be specified by the user.
* `project` - (Optional) The ID of the project that the trigger will be created in.
Defaults to the provider project configuration.
* `substitutions`: (Optional) User-defined substitutions. * `substitutions`: (Optional) User-defined substitutions.
User-defined substitutions must conform to the following rules: User-defined substitutions must conform to the following rules:
* Substitutions must begin with an underscore (`_`) and use only * Substitutions must begin with an underscore (`_`) and use only
uppercase-letters and numbers (respecting the regular expression uppercase-letters and numbers (respecting the regular expression
`_[A-Z0-9_]+`). This prevents conflicts with built-in substitutions. `_[A-Z0-9_]+`). This prevents conflicts with built-in substitutions.
* Unmatched keys in the template will cause an error (for example, if a build * Unmatched keys in the template will cause an error (for example, if a build
request includes `$_FOO` and the substitutions map doesnt define `_FOO`). request includes `$_FOO` and the substitutions map doesnt define `_FOO`).
@ -94,24 +94,8 @@ User-defined substitutions must conform to the following rules:
* The length of a parameter key and the length of a parameter value * The length of a parameter key and the length of a parameter value
are limited to 100 characters. are limited to 100 characters.
--- * `trigger_template` - (Optional) Location of the source in a Google
Cloud Source Repository. Structure is documented below.
The `trigger_template` block supports:
* `branch_name` - (Optional) Name of the branch to build.
* `commit_sha` - (Optional) Explicit commit SHA to build.
* `dir` - (Optional) Directory, relative to the source root, in which to run
the build. This must be a relative path. If a step's `dir` is specified and
is an absolute path, this value is ignored for that step's execution.
* `project` - (Optional) ID of the project that owns the Cloud Source Repository.
* `repo_name` - (Optional) Name of the Cloud Source Repository.
* `tag_name` - (Optional) Name of the tag to build.
--- ---
@ -147,3 +131,22 @@ when it is started. If the image used to run the step's container has an
entrypoint, the `args` are used as arguments to that entrypoint. If the image entrypoint, the `args` are used as arguments to that entrypoint. If the image
does not define an entrypoint, the first element in args is used as the does not define an entrypoint, the first element in args is used as the
entrypoint, and the remainder will be used as arguments. entrypoint, and the remainder will be used as arguments.
---
The `trigger_template` block supports:
* `branch_name` - (Optional) Name of the branch to build.
* `commit_sha` - (Optional) Explicit commit SHA to build.
* `dir` - (Optional) Directory, relative to the source root, in which to run
the build. This must be a relative path. If a step's `dir` is specified and
is an absolute path, this value is ignored for that step's execution.
* `project` - (Optional) ID of the project that owns the Cloud Source Repository.
* `repo_name` - (Optional) Name of the Cloud Source Repository.
* `tag_name` - (Optional) Name of the tag to build.