# NOT RUN {
cr_project_set("my-project")
cr_bucket_set("my-bucket")
# creating yaml for use in deploying cloud run
image <- "gcr.io/my-project/my-image:$BUILD_ID"
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
)
# use premade docker buildstep - combine using c()
image <- "gcr.io/my-project/my-image"
cr_build_yaml(
steps = c(
cr_buildstep_docker(image),
cr_buildstep("gcloud",
args = c(
"beta", "run", "deploy",
"test1", "--image", image
)
)
),
images = image
)
# list files with a new entrypoint for gcloud
cr_build_yaml(steps = cr_buildstep("gcloud", c("-c", "ls -la"),
entrypoint = "bash"
))
# to call from images not using gcr.io/cloud-builders stem
cr_buildstep("alpine", c("-c", "ls -la"), entrypoint = "bash", prefix = "")
# to add environment arguments to the step
cr_buildstep("docker", "version", env = c("ENV1=env1", "ENV2=$PROJECT_ID"))
# to add volumes wrap in list()
cr_buildstep("test", "ls", volumes = list(list(name = "ssh", path = "/root/.ssh")))
# }
Run the code above in your browser using DataLab