Creates a new `BuildTrigger`.This API is experimental.

cr_buildtrigger(
  build,
  name,
  trigger,
  description = paste("cr_buildtrigger: ", Sys.time()),
  disabled = FALSE,
  substitutions = NULL,
  ignoredFiles = NULL,
  includedFiles = NULL,
  trigger_tags = NULL,
  projectId = cr_project_get(),
  overwrite = FALSE
)

Arguments

build

The build to trigger created via cr_build_make, or the file location of the cloudbuild.yaml within the trigger source

name

User assigned name of the trigger

trigger

The trigger source created via cr_buildtrigger_repo

description

Human-readable description of this trigger

disabled

If true, the trigger will never result in a build

substitutions

A named list of Build macro variables

ignoredFiles

ignored_files and included_files are file glob matches extended with support for "**".

includedFiles

If any of the files altered in the commit pass the ignored_files

trigger_tags

Tags for the buildtrigger listing

projectId

ID of the project for which to configure automatic builds

overwrite

If TRUE will overwrite an existing trigger with the same name

Details

Any source specified in the build will be overwritten to use the trigger as a source (GitHub or Cloud Source Repositories)

See also

Examples

cr_project_set("my-project")
#> 2021-09-20 15:58:59 > ProjectId set to my-project
#> [1] "my-project"
cr_bucket_set("my-bucket")
#> 2021-09-20 15:58:59 > Bucket set to my-bucket
#> [1] "my-bucket"
cloudbuild <- system.file("cloudbuild/cloudbuild.yaml", package = "googleCloudRunner") bb <- cr_build_make(cloudbuild) # repo hosted on GitHub gh_trigger <- cr_buildtrigger_repo("MarkEdmondson1234/googleCloudRunner") # repo mirrored to Cloud Source Repositories cs_trigger <- cr_buildtrigger_repo("github_markedmondson1234_googlecloudrunner", type = "cloud_source") if (FALSE) { # build with in-line build code cr_buildtrigger(bb, name = "bt-github-inline", trigger = gh_trigger) # build with in-line build code using Cloud Source Repository cr_buildtrigger(bb, name = "bt-github-inline", trigger = cs_trigger) # build pointing to cloudbuild.yaml within the GitHub repo cr_buildtrigger("inst/cloudbuild/cloudbuild.yaml", name = "bt-github-file", trigger = gh_trigger) # build with repo mirror from file cr_buildtrigger("inst/cloudbuild/cloudbuild.yaml", name = "bt-cs-file", trigger = cs_trigger) }