Write out a Build object to cloudbuild.yaml

cr_build_write(x, file = "cloudbuild.yaml", footer = TRUE)

Arguments

x

A Build object perhaps created with cr_build_make or cr_build_yaml

file

Where to write the yaml file

footer

should a comment footer with the time be added?

Examples

cr_project_set("my-project")
#>  2022-03-26 19:55:47 > ProjectId set to my-project
#> [1] "my-project"
# write from creating a Yaml object
image <- "gcr.io/my-project/my-image$BUILD_ID"
run_yaml <- 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
)
if (FALSE) {
cr_build_write(run_yaml)
}

# write from a Build object
build <- cr_build_make(system.file("cloudbuild/cloudbuild.yaml",
  package = "googleCloudRunner"
))
if (FALSE) {
cr_build_write(build)
}