This can be written to disk or used directly with functions such as cr_build
cr_build_yaml(
steps,
timeout = NULL,
logsBucket = NULL,
options = NULL,
substitutions = NULL,
tags = NULL,
secrets = NULL,
availableSecrets = NULL,
images = NULL,
artifacts = NULL,
serviceAccount = NULL
)
A vector of cr_buildstep
How long the entire build will run. If not set will be 10mins
Where logs are written. If you don't set this field, Cloud Build will use a default bucket to store your build logs.
A named list of options
Build macros that will replace entries in other elements
Tags for the build
A secrets object
What environment arguments from Secret Manager are available to the build - create via cr_build_yaml_secrets
What images will be build from this cloudbuild
What artifacts may be built from this cloudbuild - create via cr_build_yaml_artifact
What service account should the build be run under?
Build configuration overview for cloudbuild.yaml
Other Cloud Build functions:
Build()
,
RepoSource()
,
Source()
,
StorageSource()
,
cr_build_artifacts()
,
cr_build_list()
,
cr_build_logs()
,
cr_build_make()
,
cr_build_status()
,
cr_build_targets()
,
cr_build_upload_gcs()
,
cr_build_wait()
,
cr_build_write()
,
cr_build_yaml_artifact()
,
cr_build_yaml_secrets()
,
cr_build()
cr_project_set("my-project")
#> ℹ 2022-03-26 19:55:47 > ProjectId set to my-project
#> [1] "my-project"
image <- "gcr.io/my-project/my-image"
cr_build_yaml(
steps = c(
cr_buildstep("docker", c("build", "-t", image, ".")),
cr_buildstep("docker", c("push", image)),
cr_buildstep("gcloud", c("beta", "run", "deploy", "test1", "--image", image))
),
images = image
)
#> ==cloudRunnerYaml==
#> steps:
#> - name: gcr.io/cloud-builders/docker
#> args:
#> - build
#> - -t
#> - gcr.io/my-project/my-image
#> - '.'
#> - name: gcr.io/cloud-builders/docker
#> args:
#> - push
#> - gcr.io/my-project/my-image
#> - name: gcr.io/cloud-builders/gcloud
#> args:
#> - beta
#> - run
#> - deploy
#> - test1
#> - --image
#> - gcr.io/my-project/my-image
#> images:
#> - gcr.io/my-project/my-image