Useful for editing existing buildsteps

cr_buildstep_edit(x, ...)

Arguments

x

A buildstep created previously

...

Arguments passed on to cr_buildstep

name

name of docker image to call appended to prefix

args

character vector of arguments

prefix

prefixed to name - set to "" to suppress. Will be suppressed if name starts with gcr.io

entrypoint

change the entrypoint for the docker container

dir

The directory to use, relative to /workspace e.g. /workspace/deploy/

id

Optional id for the step

env

Environment variables for this step. A character vector for each assignment

volumes

volumes to connect and write to

waitFor

Whether to wait for previous buildsteps to complete before running. Default it will wait for previous step.

See also

Examples

package_build <- system.file("cloudbuild/cloudbuild.yaml", package = "googleCloudRunner") build <- cr_build_make(package_build) build
#> ==CloudBuildObject== #> steps: #> - name: gcr.io/cloud-builders/docker #> id: Docker Version #> args: version #> - name: alpine #> id: Hello Cloud Build #> args: #> - echo #> - Hello Cloud Build #> - name: rocker/r-base #> id: Hello R #> args: #> - Rscript #> - -e #> - paste0('1 + 1 = ', 1+1)
cr_buildstep_extract(build, step = 1)
#> [[1]] #> ==cloudRunnerBuildStep== #> name: gcr.io/cloud-builders/docker #> args: #> - version #> id: Docker Version #>
cr_buildstep_extract(build, step = 2)
#> [[1]] #> ==cloudRunnerBuildStep== #> name: alpine #> args: #> - echo #> - Hello Cloud Build #> id: Hello Cloud Build #>
edit_me <- cr_buildstep_extract(build, step = 2) cr_buildstep_edit(edit_me, name = "blah")
#> [[1]] #> ==cloudRunnerBuildStep== #> name: gcr.io/cloud-builders/blah #> args: #> - echo #> - Hello Cloud Build #> id: Hello Cloud Build #>
cr_buildstep_edit(edit_me, name = "gcr.io/blah")
#> [[1]] #> ==cloudRunnerBuildStep== #> name: gcr.io/blah #> args: #> - echo #> - Hello Cloud Build #> id: Hello Cloud Build #>
cr_buildstep_edit(edit_me, args = c("blah1","blah2"), dir = "meh")
#> [[1]] #> ==cloudRunnerBuildStep== #> name: gcr.io/cloud-builders/alpine #> args: #> - blah1 #> - blah2 #> id: Hello Cloud Build #> dir: meh #>