This Terraform module creates Google Cloud Build triggers for a specified GitHub repository. It supports push, tag and pull request triggers.
location
: The location of the Cloud Build triggers.owner
: The owner of the GitHub repository.repository
: The name of the GitHub repository.triggers
: List of trigger configurations. Each configuration is an object with the following attributes:name
: The name of the Cloud Build trigger.tags
: List of tags to apply to the trigger.sa
: The service account to use for the trigger.ignored_files
: List of file globs to ignore for the trigger.included_files
: List of file globs to include for the trigger.event
: The type of trigger (push
,tag
orpull_request
).regex
: The pattern to match for triggering builds (branch onpush
, tag ontag
, base branch onpull_request
).invert_regex
: Whether to invert the regex pattern.send_build_logs
: Whether to send build logs to GitHub.
module "cloud_build_triggers" {
source = "git::https://github.com/layer-3/terraform-layer-3-cloud-build.git"
location = "global"
owner = "layer-3"
repository = "terraform-layer-3-cloud-build"
triggers = [
{
name = "master-push"
tags = ["master", "push"]
sa = "sa-name"
ignored_files = [".gitignore"]
event = "push"
regex = "^master$"
send_build_logs = true
}
]
}
This module is maintained by philanton.
This module is licensed under the MIT License.