Helper to turn a data.frame of buildsteps info into format accepted by cr_build

cr_buildstep_df(x)

Arguments

x

A data.frame of steps to turn into buildsteps, with at least name and args columns

Details

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

Examples

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
#>