This lets you download the logs to your local R session, rather than viewing them in the Cloud Console.
cr_build_logs(built = NULL, log_url = NULL)
cr_buildtrigger_logs(
trigger_name = NULL,
trigger_id = NULL,
projectId = cr_project_get()
)
The built object from cr_build_status or cr_build_wait
You can optionally instead of built
provide the direct gs:// URI to the log here. It is in the format gs://{{bucket}}/log-{{buildId}}.txt
The trigger name to check, will be used to look up trigger_id
If supplied, trigger_name will be ignored
The project containing the trigger_id
By default, Cloud Build stores your build logs in a Google-created Cloud Storage bucket. You can view build logs store in the Google-created Cloud Storage bucket, but you cannot make any other changes to it. If you require full control over your logs bucket, store the logs in a user-created Cloud Storage bucket.
https://cloud.google.com/build/docs/securing-builds/store-manage-build-logs
cr_build_logs_badger to see logs for a badger created build
Other Cloud Build functions:
Build()
,
RepoSource()
,
Source()
,
StorageSource()
,
cr_build_artifacts()
,
cr_build_list()
,
cr_build_make()
,
cr_build_status()
,
cr_build_targets()
,
cr_build_upload_gcs()
,
cr_build_wait()
,
cr_build_write()
,
cr_build_yaml_artifact()
,
cr_build_yaml_secrets()
,
cr_build_yaml()
,
cr_build()
if (FALSE) {
s_yaml <- cr_build_yaml(steps = cr_buildstep("gcloud", "version"))
build <- cr_build_make(s_yaml)
built <- cr_build(build)
the_build <- cr_build_wait(built)
cr_build_logs(the_build)
# [1] "starting build \"6ce86e05-b0b1-4070-a849-05ec9020fd3b\""
# [2] ""
# [3] "FETCHSOURCE"
# [4] "BUILD"
# [5] "Already have image (with digest): gcr.io/cloud-builders/gcloud"
# [6] "Google Cloud SDK 325.0.0"
# [7] "alpha 2021.01.22"
# [8] "app-engine-go 1.9.71"
# ...
}
if (FALSE) {
# get your trigger name
ts <- cr_buildtrigger_list()
ts$buildTriggerName
my_trigger <- "package-checks"
last_logs <- cr_buildtrigger_logs(my_trigger)
my_trigger_id <- "0a3cade0-425f-4adc-b86b-14cde51af674"
last_logs <- cr_buildtrigger_logs(trigger_id = my_trigger_id)
}