If a completed build includes artifact files this downloads them to local files

cr_build_artifacts(
  build,
  download_folder = getwd(),
  overwrite = FALSE,
  path_regex = NULL
)

Arguments

build

A Build object that includes the artifact location

download_folder

Where to download the artifact files

overwrite

Whether to overwrite existing local data

path_regex

A regex of files to fetch from the artifact bucket location. This is due to not being able to support the path globs

Details

If your artifacts are using file glob (e.g. myfolder/**) to decide which workspace files are uploaded to Cloud Storage, you will need to create a path_regex of similar functionality ("^myfolder/"). This is not needed if you use absolute path names such as "myfile.csv"

Examples

if (FALSE) {
#' r <- "write.csv(mtcars,file = 'artifact.csv')"
ba <- cr_build_yaml(
  steps = cr_buildstep_r(r),
  artifacts = cr_build_yaml_artifact("artifact.csv", bucket = "my-bucket")
)
ba

build <- cr_build(ba)
built <- cr_build_wait(build)

cr_build_artifacts(built)
}