R/cloudbuild_schedule.R
cr_build_schedule_http.Rd
This enables Cloud Scheduler to trigger Cloud Builds
cr_build_schedule_http( build, email = cr_email_get(), projectId = cr_project_get() )
build | A Build object created via cr_build_make or cr_build |
---|---|
The email that will authenticate the job set via cr_email_set |
|
projectId | The projectId |
A HttpTarget object for use in cr_schedule
Ensure you have a service email with cr_email_set of format service-{project-number}@gcp-sa-cloudscheduler.iam.gserviceaccount.com
with Cloud Scheduler Service Agent role as per https://cloud.google.com/scheduler/docs/http-target-auth#add
https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds/create
Other Cloud Scheduler functions:
HttpTarget()
,
Job()
,
cr_run_schedule_http()
,
cr_schedule_delete()
,
cr_schedule_get()
,
cr_schedule_list()
,
cr_schedule_pause()
,
cr_schedule_run()
,
cr_schedule()
cloudbuild <- system.file("cloudbuild/cloudbuild.yaml", package = "googleCloudRunner") build1 <- cr_build_make(cloudbuild) build1#> ==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)if (FALSE) { cr_schedule("cloud-build-test1", schedule="15 5 * * *", httpTarget = cr_build_schedule_http(build1)) # a cloud build you would like to schedule itworks <- cr_build("cloudbuild.yaml", launch_browser = FALSE) # once working, pass in the build to the scheduler cr_schedule("itworks-schedule", schedule = "15 5 * * *", httpTarget = cr_build_schedule_http(itworks)) }