Helper to turn a data.frame of buildsteps info into format accepted by cr_build
cr_buildstep_df(x)
A data.frame of steps to turn into buildsteps, with at least name and args columns
This helps convert the output of cr_build into valid cr_buildstep so it can be sent back into the API
If constructing arg list columns then I suppresses conversion of the list to columns that would otherwise break the yaml format
Other Cloud Buildsteps:
cr_buildstep_bash()
,
cr_buildstep_decrypt()
,
cr_buildstep_docker()
,
cr_buildstep_edit()
,
cr_buildstep_extract()
,
cr_buildstep_gcloud()
,
cr_buildstep_gitsetup()
,
cr_buildstep_mailgun()
,
cr_buildstep_nginx_setup()
,
cr_buildstep_packagetests()
,
cr_buildstep_pkgdown()
,
cr_buildstep_run()
,
cr_buildstep_r()
,
cr_buildstep_secret()
,
cr_buildstep_slack()
,
cr_buildstep_targets()
,
cr_buildstep()
y <- data.frame(
name = c("docker", "alpine"),
args = I(list(c("version"), c("echo", "Hello Cloud Build"))),
id = c("Docker Version", "Hello Cloud Build"),
prefix = c(NA, ""),
stringsAsFactors = FALSE
)
cr_buildstep_df(y)
#> [[1]]
#> ==cloudRunnerBuildStep==
#> name: gcr.io/cloud-builders/docker
#> args:
#> - version
#> id: Docker Version
#>
#> [[2]]
#> ==cloudRunnerBuildStep==
#> name: alpine
#> args:
#> - echo
#> - Hello Cloud Build
#> id: Hello Cloud Build
#>