Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cloudbuild invert regex option #3628

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions products/cloudbuild/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ objects:
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.

- !ruby/object:Api::Type::Boolean
name: 'invertRegex'
description: |
Only trigger a build if the revision regex does NOT match the revision regex.
- !ruby/object:Api::Type::String
name: 'branchName'
description: |
Expand Down Expand Up @@ -198,6 +203,10 @@ objects:
values:
- :COMMENTS_DISABLED
- :COMMENTS_ENABLED
- !ruby/object:Api::Type::Boolean
name: 'invertRegex'
description: |
If true, branches that do NOT match the git_ref will trigger a build.
- !ruby/object:Api::Type::NestedObject
name: 'push'
description: |
Expand All @@ -206,6 +215,10 @@ objects:
- github.0.pull_request
- github.0.push
properties:
- !ruby/object:Api::Type::Boolean
name: 'invertRegex'
description: |
When true, only trigger a build if the revision regex does NOT match the git_ref regex.
- !ruby/object:Api::Type::String
name: 'branch'
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ resource "google_cloudbuild_trigger" "build_trigger" {
trigger_template {
branch_name = "master"
repo_name = "some-repo"
invert_regex = false
}
build {
images = ["gcr.io/$PROJECT_ID/$REPO_NAME:$COMMIT_SHA"]
Expand Down Expand Up @@ -221,6 +222,7 @@ resource "google_cloudbuild_trigger" "build_trigger" {
trigger_template {
branch_name = "master-updated"
repo_name = "some-repo-updated"
invert_regex = true
}
build {
images = ["gcr.io/$PROJECT_ID/$REPO_NAME:$SHORT_SHA"]
Expand Down