From 33eac798eabdc8fae4f84d6e217af2eaba06fff6 Mon Sep 17 00:00:00 2001 From: Mark IIH Date: Wed, 8 Jan 2020 17:28:46 +0100 Subject: [PATCH] Remove containerit dependency for CRAN #32 add documentation --- NAMESPACE | 2 +- R/deploy-run.R | 10 +++--- R/docker.R | 37 ++++--------------- man/Build.Rd | 57 ++++++++++------------------- man/BuildTrigger.Rd | 34 +++++++----------- man/GitHubEventsConfig.Rd | 27 ++++++-------- man/HttpTarget.Rd | 24 +++++-------- man/Job.Rd | 35 ++++++------------ man/RepoSource.Rd | 33 +++++++---------- man/Source.Rd | 23 ++++++------ man/StorageSource.Rd | 23 ++++++------ man/cr_build.Rd | 38 ++++++++------------ man/cr_build_artifacts.Rd | 30 ++++++---------- man/cr_build_make.Rd | 36 +++++++------------ man/cr_build_schedule_http.Rd | 7 ++-- man/cr_build_status.Rd | 23 ++++++------ man/cr_build_upload_gcs.Rd | 33 +++++++---------- man/cr_build_wait.Rd | 23 ++++++------ man/cr_build_write.Rd | 23 ++++++------ man/cr_build_yaml.Rd | 38 ++++++++------------ man/cr_build_yaml_artifact.Rd | 26 +++++++------- man/cr_buildstep.Rd | 43 +++++++++------------- man/cr_buildstep_bash.Rd | 35 ++++++++---------- man/cr_buildstep_decrypt.Rd | 30 ++++++++-------- man/cr_buildstep_df.Rd | 27 +++++++------- man/cr_buildstep_docker.Rd | 36 ++++++++----------- man/cr_buildstep_edit.Rd | 52 +++++++++++++-------------- man/cr_buildstep_extract.Rd | 27 +++++++------- man/cr_buildstep_git.Rd | 41 +++++++++------------ man/cr_buildstep_mailgun.Rd | 38 ++++++++------------ man/cr_buildstep_nginx_setup.Rd | 27 +++++++------- man/cr_buildstep_pkgdown.Rd | 39 +++++++++----------- man/cr_buildstep_r.Rd | 36 ++++++++----------- man/cr_buildstep_run.Rd | 37 ++++++++----------- man/cr_buildstep_slack.Rd | 38 ++++++++------------ man/cr_buildtrigger.Rd | 33 +++++++---------- man/cr_buildtrigger_delete.Rd | 17 +++++---- man/cr_buildtrigger_edit.Rd | 20 +++++------ man/cr_buildtrigger_get.Rd | 17 +++++---- man/cr_buildtrigger_list.Rd | 17 +++++---- man/cr_buildtrigger_make.Rd | 44 +++++++++++------------ man/cr_buildtrigger_run.Rd | 17 +++++---- man/cr_deploy_docker.Rd | 25 +++++-------- man/cr_deploy_git_html.Rd | 29 +++++---------- man/cr_deploy_github_docker.Rd | 23 ++++-------- man/cr_deploy_pkgdown.Rd | 24 +++++-------- man/cr_deploy_r.Rd | 29 +++++---------- man/cr_deploy_run.Rd | 64 +++++++++++---------------------- man/cr_plumber_pubsub.Rd | 6 ++-- man/cr_region_set.Rd | 5 ++- man/cr_run.Rd | 19 +++------- man/cr_run_get.Rd | 6 ++-- man/cr_run_list.Rd | 14 +++----- man/cr_schedule.Rd | 26 +++++--------- man/cr_schedule_delete.Rd | 16 ++++----- man/cr_schedule_get.Rd | 16 ++++----- man/cr_schedule_list.Rd | 16 ++++----- man/cr_schedule_pause.Rd | 19 +++++----- man/cr_schedule_run.Rd | 17 +++++---- man/googleCloudRunner.Rd | 1 + vignettes/cloudrun.Rmd | 63 +++++++++++++++++++++++++++++--- 61 files changed, 691 insertions(+), 980 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 2a663f00..39cd5344 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -67,7 +67,6 @@ export(cr_deploy_pkgdown) export(cr_deploy_plumber) export(cr_deploy_r) export(cr_deploy_run) -export(cr_dockerfile_plumber) export(cr_email_get) export(cr_email_set) export(cr_plumber_pubsub) @@ -98,6 +97,7 @@ importFrom(httr,content) importFrom(jsonlite,base64_enc) importFrom(jsonlite,toJSON) importFrom(openssl,base64_encode) +importFrom(utils,modifyList) importFrom(utils,str) importFrom(utils,tar) importFrom(yaml,as.yaml) diff --git a/R/deploy-run.R b/R/deploy-run.R index 9e164411..b25e0e71 100644 --- a/R/deploy-run.R +++ b/R/deploy-run.R @@ -161,10 +161,12 @@ cr_deploy_plumber <- function(api, # if no dockerfile, attempt to create it if(is.null(dockerfile)){ - myMessage("Creating plumber Dockerfile from ",local, level = 3) - # creates and write a dockerfile to the folder - cr_dockerfile_plumber(local) - + if(!"Dockerfile" %in% local_files){ + myMessage("No Dockerfile detected in ",local, level = 3) + cr_dockerfile_plumber(local) + } else { + myMessage("Using existing Dockerfile found in folder", level = 3) + } } cr_deploy_run(local = local, diff --git a/R/docker.R b/R/docker.R index 5c200d32..04815598 100644 --- a/R/docker.R +++ b/R/docker.R @@ -1,11 +1,12 @@ #' Create Dockerfile in the deployment folder #' -#' This uses \link[containerit]{dockerfile} to create a Dockerfile if possible +#' This did call containerit but its not on CRAN so removed +#' +#' @noRd #' #' @param deploy_folder The folder containing the assessts to deploy -#' @param ... Other arguments pass to \link[containerit]{dockerfile} +#' @param ... Other arguments pass to containerit::dockerfile #' -#' @export #' #' @return An object of class Dockerfile #' @@ -15,33 +16,9 @@ #' cr_dockerfile_plumber(system.file("example/", package = "googleCloudRunner")) #' } cr_dockerfile_plumber <- function(deploy_folder, ...){ - check_package_installed("containerit") - docker <- suppressWarnings( - containerit::dockerfile( - deploy_folder, - image = "trestletech/plumber", - offline = FALSE, - cmd = containerit::Cmd("api.R"), - maintainer = NULL, - copy = list("./"), - container_workdir = NULL, - entrypoint = containerit::Entrypoint("R", - params = list("-e", - "pr <- plumber::plumb(commandArgs()[4]); pr$run(host='0.0.0.0', port=as.numeric(Sys.getenv('PORT')))")), - filter_baseimage_pkgs = FALSE, - ...)) - - write_to <- file.path(deploy_folder, "Dockerfile") - containerit::write(docker, file = write_to) - - assert_that( - is.readable(write_to) - ) - - myMessage("Written Dockerfile to ", write_to, level = 3) - containerit::print(docker) - docker - + stop( + "No Dockerfile detected. Please create one in the deployment folder. See a guide on website on how to use library(containerit) to do so: https://code.markedmondson.me/googleCloudRunner/articles/cloudrun.html#creating-a-dockerfile-with-containerit" + , call. = FALSE) } find_dockerfile <- function(local, dockerfile){ diff --git a/man/Build.Rd b/man/Build.Rd index 0ae49082..e8e96408 100644 --- a/man/Build.Rd +++ b/man/Build.Rd @@ -4,32 +4,14 @@ \alias{Build} \title{Build Object} \usage{ -Build( - Build.substitutions = NULL, - Build.timing = NULL, - results = NULL, - logsBucket = NULL, - steps = NULL, - buildTriggerId = NULL, - id = NULL, - tags = NULL, - startTime = NULL, - substitutions = NULL, - timing = NULL, - sourceProvenance = NULL, - createTime = NULL, - images = NULL, - projectId = NULL, - logUrl = NULL, - finishTime = NULL, - source = NULL, - options = NULL, - timeout = NULL, - status = NULL, - statusDetail = NULL, - artifacts = NULL, - secrets = NULL -) +Build(Build.substitutions = NULL, Build.timing = NULL, + results = NULL, logsBucket = NULL, steps = NULL, + buildTriggerId = NULL, id = NULL, tags = NULL, startTime = NULL, + substitutions = NULL, timing = NULL, sourceProvenance = NULL, + createTime = NULL, images = NULL, projectId = NULL, + logUrl = NULL, finishTime = NULL, source = NULL, options = NULL, + timeout = NULL, status = NULL, statusDetail = NULL, + artifacts = NULL, secrets = NULL) } \arguments{ \item{Build.substitutions}{The Build.substitutions object or list of objects} @@ -107,18 +89,15 @@ Fields can include the following variables, which will be expanded when the buil } \seealso{ -Other Cloud Build functions: -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{RepoSource}}, + \code{\link{Source}}, \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/BuildTrigger.Rd b/man/BuildTrigger.Rd index 6fccabc6..590e8e95 100644 --- a/man/BuildTrigger.Rd +++ b/man/BuildTrigger.Rd @@ -4,19 +4,10 @@ \alias{BuildTrigger} \title{BuildTrigger Object} \usage{ -BuildTrigger( - filename = NULL, - name = NULL, - tags = NULL, - build = NULL, - ignoredFiles = NULL, - github = NULL, - substitutions = NULL, - includedFiles = NULL, - disabled = NULL, - triggerTemplate = NULL, - description = NULL -) +BuildTrigger(filename = NULL, name = NULL, tags = NULL, + build = NULL, ignoredFiles = NULL, github = NULL, + substitutions = NULL, includedFiles = NULL, disabled = NULL, + triggerTemplate = NULL, description = NULL) } \arguments{ \item{filename}{Path, from the source root, to a file whose contents is used for the} @@ -50,14 +41,13 @@ Configuration for an automated build in response to source repositorychanges. \seealso{ \url{https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.triggers} -Other BuildTrigger functions: -\code{\link{GitHubEventsConfig}()}, -\code{\link{cr_buildtrigger_delete}()}, -\code{\link{cr_buildtrigger_edit}()}, -\code{\link{cr_buildtrigger_get}()}, -\code{\link{cr_buildtrigger_list}()}, -\code{\link{cr_buildtrigger_make}()}, -\code{\link{cr_buildtrigger_run}()}, -\code{\link{cr_buildtrigger}()} +Other BuildTrigger functions: \code{\link{GitHubEventsConfig}}, + \code{\link{cr_buildtrigger_delete}}, + \code{\link{cr_buildtrigger_edit}}, + \code{\link{cr_buildtrigger_get}}, + \code{\link{cr_buildtrigger_list}}, + \code{\link{cr_buildtrigger_make}}, + \code{\link{cr_buildtrigger_run}}, + \code{\link{cr_buildtrigger}} } \concept{BuildTrigger functions} diff --git a/man/GitHubEventsConfig.Rd b/man/GitHubEventsConfig.Rd index d34346e1..dbc3b616 100644 --- a/man/GitHubEventsConfig.Rd +++ b/man/GitHubEventsConfig.Rd @@ -4,13 +4,9 @@ \alias{GitHubEventsConfig} \title{GitHubEventsConfig Object} \usage{ -GitHubEventsConfig( - x, - event = c("push", "pull"), - branch = ".*", - tag = NULL, - commentControl = c("COMMENTS_DISABLED", "COMMENTS_ENABLED") -) +GitHubEventsConfig(x, event = c("push", "pull"), branch = ".*", + tag = NULL, commentControl = c("COMMENTS_DISABLED", + "COMMENTS_ENABLED")) } \arguments{ \item{x}{The repository in format {owner}/{repo} e.g. MarkEdmondson1234/googleCloudRunner} @@ -33,14 +29,13 @@ GitHubEventsConfig Object The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at \url{https://github.com/google/re2/wiki/Syntax} } \seealso{ -Other BuildTrigger functions: -\code{\link{BuildTrigger}()}, -\code{\link{cr_buildtrigger_delete}()}, -\code{\link{cr_buildtrigger_edit}()}, -\code{\link{cr_buildtrigger_get}()}, -\code{\link{cr_buildtrigger_list}()}, -\code{\link{cr_buildtrigger_make}()}, -\code{\link{cr_buildtrigger_run}()}, -\code{\link{cr_buildtrigger}()} +Other BuildTrigger functions: \code{\link{BuildTrigger}}, + \code{\link{cr_buildtrigger_delete}}, + \code{\link{cr_buildtrigger_edit}}, + \code{\link{cr_buildtrigger_get}}, + \code{\link{cr_buildtrigger_list}}, + \code{\link{cr_buildtrigger_make}}, + \code{\link{cr_buildtrigger_run}}, + \code{\link{cr_buildtrigger}} } \concept{BuildTrigger functions} diff --git a/man/HttpTarget.Rd b/man/HttpTarget.Rd index 57bda14f..8e72a43f 100644 --- a/man/HttpTarget.Rd +++ b/man/HttpTarget.Rd @@ -4,14 +4,8 @@ \alias{HttpTarget} \title{HttpTarget Object} \usage{ -HttpTarget( - headers = NULL, - body = NULL, - oauthToken = NULL, - uri = NULL, - oidcToken = NULL, - httpMethod = NULL -) +HttpTarget(headers = NULL, body = NULL, oauthToken = NULL, + uri = NULL, oidcToken = NULL, httpMethod = NULL) } \arguments{ \item{headers}{A named list of HTTP headers e.g. \code{list(Blah = "yes", Boo = "no")}} @@ -35,13 +29,11 @@ HttpTarget Object \seealso{ https://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs#HttpTarget -Other Cloud Scheduler functions: -\code{\link{Job}()}, -\code{\link{cr_schedule_delete}()}, -\code{\link{cr_schedule_get}()}, -\code{\link{cr_schedule_list}()}, -\code{\link{cr_schedule_pause}()}, -\code{\link{cr_schedule_run}()}, -\code{\link{cr_schedule}()} +Other Cloud Scheduler functions: \code{\link{Job}}, + \code{\link{cr_schedule_delete}}, + \code{\link{cr_schedule_get}}, + \code{\link{cr_schedule_list}}, + \code{\link{cr_schedule_pause}}, + \code{\link{cr_schedule_run}}, \code{\link{cr_schedule}} } \concept{Cloud Scheduler functions} diff --git a/man/Job.Rd b/man/Job.Rd index 765785c2..20349ffe 100644 --- a/man/Job.Rd +++ b/man/Job.Rd @@ -4,22 +4,11 @@ \alias{Job} \title{Job Schedule Object} \usage{ -Job( - attemptDeadline = NULL, - pubsubTarget = NULL, - httpTarget = NULL, - timeZone = NULL, - description = NULL, - appEngineHttpTarget = NULL, - status = NULL, - retryConfig = NULL, - state = NULL, - name = NULL, - lastAttemptTime = NULL, - scheduleTime = NULL, - schedule = NULL, - userUpdateTime = NULL -) +Job(attemptDeadline = NULL, pubsubTarget = NULL, httpTarget = NULL, + timeZone = NULL, description = NULL, appEngineHttpTarget = NULL, + status = NULL, retryConfig = NULL, state = NULL, name = NULL, + lastAttemptTime = NULL, scheduleTime = NULL, schedule = NULL, + userUpdateTime = NULL) } \arguments{ \item{attemptDeadline}{The deadline for job attempts} @@ -60,13 +49,11 @@ Job Schedule Object Configuration for a job.The maximum allowed size for a job is 100KB. } \seealso{ -Other Cloud Scheduler functions: -\code{\link{HttpTarget}()}, -\code{\link{cr_schedule_delete}()}, -\code{\link{cr_schedule_get}()}, -\code{\link{cr_schedule_list}()}, -\code{\link{cr_schedule_pause}()}, -\code{\link{cr_schedule_run}()}, -\code{\link{cr_schedule}()} +Other Cloud Scheduler functions: \code{\link{HttpTarget}}, + \code{\link{cr_schedule_delete}}, + \code{\link{cr_schedule_get}}, + \code{\link{cr_schedule_list}}, + \code{\link{cr_schedule_pause}}, + \code{\link{cr_schedule_run}}, \code{\link{cr_schedule}} } \concept{Cloud Scheduler functions} diff --git a/man/RepoSource.Rd b/man/RepoSource.Rd index 64ba79f2..7ca06800 100644 --- a/man/RepoSource.Rd +++ b/man/RepoSource.Rd @@ -4,14 +4,8 @@ \alias{RepoSource} \title{RepoSource Object} \usage{ -RepoSource( - repoName = NULL, - tagName = NULL, - commitSha = NULL, - branchName = NULL, - dir = NULL, - projectId = NULL -) +RepoSource(repoName = NULL, tagName = NULL, commitSha = NULL, + branchName = NULL, dir = NULL, projectId = NULL) } \arguments{ \item{repoName}{Name of the Cloud Source Repository} @@ -57,18 +51,15 @@ build <- cr_build( } } \seealso{ -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{Source}}, \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/Source.Rd b/man/Source.Rd index f4645808..aad6e0fd 100644 --- a/man/Source.Rd +++ b/man/Source.Rd @@ -36,18 +36,15 @@ build2 <- cr_build("cloudbuild.yaml", source = my_repo_source) } } \seealso{ -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/StorageSource.Rd b/man/StorageSource.Rd index 15d5a4d7..76d63888 100644 --- a/man/StorageSource.Rd +++ b/man/StorageSource.Rd @@ -38,18 +38,15 @@ build2 <- cr_build("cloudbuild.yaml", source = my_gcs_source2) } } \seealso{ -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_build.Rd b/man/cr_build.Rd index 3221c7a6..64334b2f 100644 --- a/man/cr_build.Rd +++ b/man/cr_build.Rd @@ -4,17 +4,9 @@ \alias{cr_build} \title{Starts a build with the specified configuration.} \usage{ -cr_build( - x, - source = NULL, - timeout = NULL, - images = NULL, - substitutions = NULL, - artifacts = NULL, - options = NULL, - projectId = cr_project_get(), - launch_browser = interactive() -) +cr_build(x, source = NULL, timeout = NULL, images = NULL, + substitutions = NULL, artifacts = NULL, options = NULL, + projectId = cr_project_get(), launch_browser = interactive()) } \arguments{ \item{x}{A cloudbuild.yaml file location or an R object that will be turned into yaml via \link[yaml]{as.yaml} or a \link{Build} object created by \link{cr_build_make} or from a previous build you want to rerun.} @@ -83,18 +75,16 @@ cr_build(build2, substitutions = list(`_SUB` = "yo")) \seealso{ \href{https://cloud.google.com/cloud-build/docs/}{Google Documentation for Cloud Build} -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}} } \concept{Cloud Build functions} diff --git a/man/cr_build_artifacts.Rd b/man/cr_build_artifacts.Rd index 01d11cc4..e9ddce59 100644 --- a/man/cr_build_artifacts.Rd +++ b/man/cr_build_artifacts.Rd @@ -4,12 +4,8 @@ \alias{cr_build_artifacts} \title{Download artifacts from a build} \usage{ -cr_build_artifacts( - build, - download_folder = getwd(), - overwrite = FALSE, - path_regex = NULL -) +cr_build_artifacts(build, download_folder = getwd(), overwrite = FALSE, + path_regex = NULL) } \arguments{ \item{build}{A \link{Build} object that includes the artifact location} @@ -45,18 +41,14 @@ cr_build_artifacts(built) \seealso{ \href{Storing images and artifacts}{https://cloud.google.com/cloud-build/docs/configuring-builds/store-images-artifacts} -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_build_make.Rd b/man/cr_build_make.Rd index 500ecb14..6bb18edf 100644 --- a/man/cr_build_make.Rd +++ b/man/cr_build_make.Rd @@ -4,16 +4,9 @@ \alias{cr_build_make} \title{Make a Cloud Build object out of a cloudbuild.yml file} \usage{ -cr_build_make( - yaml, - source = NULL, - timeout = NULL, - images = NULL, - artifacts = NULL, - options = NULL, - substitutions = NULL, - projectId = cr_project_get() -) +cr_build_make(yaml, source = NULL, timeout = NULL, images = NULL, + artifacts = NULL, options = NULL, substitutions = NULL, + projectId = cr_project_get()) } \arguments{ \item{yaml}{A \code{Yaml} object created from \link{cr_build_yaml} or a file location of a .yaml/.yml cloud build file} @@ -43,18 +36,15 @@ cr_build_make(cloudbuild, projectId = "test-project") \seealso{ https://cloud.google.com/cloud-build/docs/build-config -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_build_schedule_http.Rd b/man/cr_build_schedule_http.Rd index 76404276..43bcb6c0 100644 --- a/man/cr_build_schedule_http.Rd +++ b/man/cr_build_schedule_http.Rd @@ -4,11 +4,8 @@ \alias{cr_build_schedule_http} \title{Create a Cloud Scheduler HTTP target from a Cloud Build object} \usage{ -cr_build_schedule_http( - build, - email = cr_email_get(), - projectId = cr_project_get() -) +cr_build_schedule_http(build, email = cr_email_get(), + projectId = cr_project_get()) } \arguments{ \item{build}{A \link{Build} object created via \link{cr_build_make} or \link{cr_build}} diff --git a/man/cr_build_status.Rd b/man/cr_build_status.Rd index 883a42e5..79186b33 100644 --- a/man/cr_build_status.Rd +++ b/man/cr_build_status.Rd @@ -20,18 +20,15 @@ The `Build` that is returned includes its status (such as `SUCCESS`,`FAILURE`, o \seealso{ https://cloud.google.com/cloud-build/docs/api/reference/rest/Shared.Types/Status -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_build_upload_gcs.Rd b/man/cr_build_upload_gcs.Rd index f27c27c0..380ee388 100644 --- a/man/cr_build_upload_gcs.Rd +++ b/man/cr_build_upload_gcs.Rd @@ -4,13 +4,9 @@ \alias{cr_build_upload_gcs} \title{Create a StorageSource} \usage{ -cr_build_upload_gcs( - local, - remote = paste0(local, format(Sys.time(), "\%Y\%m\%d\%H\%M\%S"), ".tar.gz"), - bucket = cr_bucket_get(), - predefinedAcl = "bucketOwnerFullControl", - deploy_folder = "deploy" -) +cr_build_upload_gcs(local, remote = paste0(local, format(Sys.time(), + "\%Y\%m\%d\%H\%M\%S"), ".tar.gz"), bucket = cr_bucket_get(), + predefinedAcl = "bucketOwnerFullControl", deploy_folder = "deploy") } \arguments{ \item{local}{Local directory containing the Dockerfile etc. you wish to deploy} @@ -42,18 +38,15 @@ build1 <- cr_build("cloudbuild.yaml", source = my_gcs_source) } } \seealso{ -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_build_wait.Rd b/man/cr_build_wait.Rd index d35de4eb..2d173d0a 100644 --- a/man/cr_build_wait.Rd +++ b/man/cr_build_wait.Rd @@ -18,18 +18,15 @@ A gar_Build object \link{Build} This will repeatedly call \link{cr_build_status} whilst the status is STATUS_UNKNOWN, QUEUED or WORKING } \seealso{ -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_build_write.Rd b/man/cr_build_write.Rd index ff086136..27489e74 100644 --- a/man/cr_build_write.Rd +++ b/man/cr_build_write.Rd @@ -32,18 +32,15 @@ cr_build_write(build) } \seealso{ -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_build_yaml.Rd b/man/cr_build_yaml.Rd index 76904531..d517cc57 100644 --- a/man/cr_build_yaml.Rd +++ b/man/cr_build_yaml.Rd @@ -4,17 +4,9 @@ \alias{cr_build_yaml} \title{Create a cloudbuild Yaml object in R} \usage{ -cr_build_yaml( - steps, - timeout = NULL, - logsBucket = NULL, - options = NULL, - substitutions = NULL, - tags = NULL, - secrets = NULL, - images = NULL, - artifacts = NULL -) +cr_build_yaml(steps, timeout = NULL, logsBucket = NULL, + options = NULL, substitutions = NULL, tags = NULL, + secrets = NULL, images = NULL, artifacts = NULL) } \arguments{ \item{steps}{A vector of \link{cr_buildstep}} @@ -49,18 +41,16 @@ cr_build_yaml(steps = c( \seealso{ \href{Build configuration overview for cloudbuild.yaml}{https://cloud.google.com/cloud-build/docs/build-config} -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml_artifact}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml_artifact}}, + \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_build_yaml_artifact.Rd b/man/cr_build_yaml_artifact.Rd index f474336e..13d27cdd 100644 --- a/man/cr_build_yaml_artifact.Rd +++ b/man/cr_build_yaml_artifact.Rd @@ -4,7 +4,8 @@ \alias{cr_build_yaml_artifact} \title{Add an artifact for cloudbuild.yaml} \usage{ -cr_build_yaml_artifact(paths, bucket_dir = NULL, bucket = cr_bucket_get()) +cr_build_yaml_artifact(paths, bucket_dir = NULL, + bucket = cr_bucket_get()) } \arguments{ \item{paths}{Which files from the working directory to upload to cloud storage once the build is finished. Can use globs but see details of \link{cr_build_artifacts} on how that affects downloads} @@ -25,18 +26,15 @@ cr_build_yaml( ) } \seealso{ -Other Cloud Build functions: -\code{\link{Build}()}, -\code{\link{RepoSource}()}, -\code{\link{Source}()}, -\code{\link{StorageSource}()}, -\code{\link{cr_build_artifacts}()}, -\code{\link{cr_build_make}()}, -\code{\link{cr_build_status}()}, -\code{\link{cr_build_upload_gcs}()}, -\code{\link{cr_build_wait}()}, -\code{\link{cr_build_write}()}, -\code{\link{cr_build_yaml}()}, -\code{\link{cr_build}()} +Other Cloud Build functions: \code{\link{Build}}, + \code{\link{RepoSource}}, \code{\link{Source}}, + \code{\link{StorageSource}}, + \code{\link{cr_build_artifacts}}, + \code{\link{cr_build_make}}, + \code{\link{cr_build_status}}, + \code{\link{cr_build_upload_gcs}}, + \code{\link{cr_build_wait}}, + \code{\link{cr_build_write}}, + \code{\link{cr_build_yaml}}, \code{\link{cr_build}} } \concept{Cloud Build functions} diff --git a/man/cr_buildstep.Rd b/man/cr_buildstep.Rd index a4d08ffa..21828f0a 100644 --- a/man/cr_buildstep.Rd +++ b/man/cr_buildstep.Rd @@ -4,17 +4,9 @@ \alias{cr_buildstep} \title{Create a yaml build step} \usage{ -cr_buildstep( - name, - args = NULL, - id = NULL, - prefix = "gcr.io/cloud-builders/", - entrypoint = NULL, - dir = "", - env = NULL, - waitFor = NULL, - volumes = NULL -) +cr_buildstep(name, args = NULL, id = NULL, + prefix = "gcr.io/cloud-builders/", entrypoint = NULL, dir = "", + env = NULL, waitFor = NULL, volumes = NULL) } \arguments{ \item{name}{name of docker image to call appended to \code{prefix}} @@ -39,7 +31,7 @@ cr_buildstep( Helper for creating build steps for upload to Cloud Build } \details{ - +This uses R to make building steps for cloudbuild.yml files harder to make mistakes with, and also means you can program creation of cloud build steps for use in R or other languages. Various templates with common use cases of buildsteps are also available that wrap this function, refer to the "See Also" section. } \section{WaitFor}{ @@ -103,19 +95,18 @@ cr_buildstep("test", "ls", volumes = list(list(name = "ssh", path = "/root/.ssh" \seealso{ \href{https://cloud.google.com/cloud-build/docs/create-custom-build-steps}{Creating custom build steps how-to guide} -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_bash.Rd b/man/cr_buildstep_bash.Rd index 5db6370e..a2dfafd8 100644 --- a/man/cr_buildstep_bash.Rd +++ b/man/cr_buildstep_bash.Rd @@ -4,12 +4,8 @@ \alias{cr_buildstep_bash} \title{Run a bash script in a Cloud Build step} \usage{ -cr_buildstep_bash( - bash_script, - name = "ubuntu", - bash_source = c("local", "runtime"), - ... -) +cr_buildstep_bash(bash_script, name = "ubuntu", + bash_source = c("local", "runtime"), ...) } \arguments{ \item{bash_script}{bash code to run or a filepath to a file containing bash code that ends with .bash or .sh} @@ -37,19 +33,18 @@ cr_build(bs) } } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_decrypt.Rd b/man/cr_buildstep_decrypt.Rd index 5d5b8ff7..c3b181ca 100644 --- a/man/cr_buildstep_decrypt.Rd +++ b/man/cr_buildstep_decrypt.Rd @@ -4,7 +4,8 @@ \alias{cr_buildstep_decrypt} \title{Create a build step for decrypting files via KMS} \usage{ -cr_buildstep_decrypt(cipher, plain, keyring, key, location = "global", ...) +cr_buildstep_decrypt(cipher, plain, keyring, key, location = "global", + ...) } \arguments{ \item{cipher}{The file that has been encrypted} @@ -39,19 +40,18 @@ cr_buildstep_decrypt("secret.json.enc", key = "my_key") } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_df.Rd b/man/cr_buildstep_df.Rd index 7a9d970c..33a4901c 100644 --- a/man/cr_buildstep_df.Rd +++ b/man/cr_buildstep_df.Rd @@ -26,19 +26,18 @@ y <- data.frame(name = c("docker", "alpine"), cr_buildstep_df(y) } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_docker.Rd b/man/cr_buildstep_docker.Rd index 04a07c8e..4af88a00 100644 --- a/man/cr_buildstep_docker.Rd +++ b/man/cr_buildstep_docker.Rd @@ -4,13 +4,8 @@ \alias{cr_buildstep_docker} \title{Create a build step to build and push a docker image} \usage{ -cr_buildstep_docker( - image, - tag = "$BUILD_ID", - location = ".", - projectId = cr_project_get(), - ... -) +cr_buildstep_docker(image, tag = "$BUILD_ID", location = ".", + projectId = cr_project_get(), ...) } \arguments{ \item{image}{The image tag that will be pushed, starting with gcr.io or created by combining with \code{projectId} if not starting with gcr.io} @@ -44,19 +39,18 @@ cr_buildtrigger("build-docker", trigger = my_repo, build = built_docker) } } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_edit.Rd b/man/cr_buildstep_edit.Rd index 542c1cd5..e81977a4 100644 --- a/man/cr_buildstep_edit.Rd +++ b/man/cr_buildstep_edit.Rd @@ -9,19 +9,18 @@ cr_buildstep_edit(x, ...) \arguments{ \item{x}{A buildstep created previously} -\item{...}{ - Arguments passed on to \code{\link[=cr_buildstep]{cr_buildstep}} - \describe{ - \item{\code{name}}{name of docker image to call appended to \code{prefix}} - \item{\code{args}}{character vector of arguments} - \item{\code{prefix}}{prefixed to name - set to "" to suppress. Will be suppressed if \code{name} starts with gcr.io} - \item{\code{entrypoint}}{change the entrypoint for the docker container} - \item{\code{dir}}{The directory to use, relative to /workspace e.g. /workspace/deploy/} - \item{\code{id}}{Optional id for the step} - \item{\code{env}}{Environment variables for this step. A character vector for each assignment} - \item{\code{volumes}}{volumes to connect and write to} - \item{\code{waitFor}}{Whether to wait for previous buildsteps to complete before running. Default it will wait for previous step.} - }} +\item{...}{Arguments passed on to \code{cr_buildstep} +\describe{ + \item{name}{name of docker image to call appended to \code{prefix}} + \item{args}{character vector of arguments} + \item{prefix}{prefixed to name - set to "" to suppress. Will be suppressed if \code{name} starts with gcr.io} + \item{entrypoint}{change the entrypoint for the docker container} + \item{dir}{The directory to use, relative to /workspace e.g. /workspace/deploy/} + \item{id}{Optional id for the step} + \item{env}{Environment variables for this step. A character vector for each assignment} + \item{volumes}{volumes to connect and write to} + \item{waitFor}{Whether to wait for previous buildsteps to complete before running. Default it will wait for previous step.} +}} } \description{ Useful for editing existing buildsteps @@ -40,19 +39,18 @@ cr_buildstep_edit(edit_me, name = "gcr.io/blah") cr_buildstep_edit(edit_me, args = c("blah1","blah2"), dir = "meh") } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_extract.Rd b/man/cr_buildstep_extract.Rd index 738fb8c8..c6e66ec4 100644 --- a/man/cr_buildstep_extract.Rd +++ b/man/cr_buildstep_extract.Rd @@ -23,19 +23,18 @@ cr_buildstep_extract(build, step = 1) cr_buildstep_extract(build, step = 2) } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_git.Rd b/man/cr_buildstep_git.Rd index e3ee7c3a..0c8a8930 100644 --- a/man/cr_buildstep_git.Rd +++ b/man/cr_buildstep_git.Rd @@ -5,17 +5,11 @@ \alias{cr_buildstep_git} \title{Create a build step for authenticating with Git} \usage{ -cr_buildstep_gitsetup( - keyring = "my-keyring", - key = "github-key", - cipher = "id_rsa.enc", - ... -) +cr_buildstep_gitsetup(keyring = "my-keyring", key = "github-key", + cipher = "id_rsa.enc", ...) -cr_buildstep_git( - git_args = c("clone", "git@github.com:[GIT-USERNAME]/[REPOSITORY]", "."), - ... -) +cr_buildstep_git(git_args = c("clone", + "git@github.com:[GIT-USERNAME]/[REPOSITORY]", "."), ...) } \arguments{ \item{keyring}{The Key Management Store keyring containing the git ssh key} @@ -55,19 +49,18 @@ cr_build_yaml( \seealso{ \href{https://cloud.google.com/cloud-build/docs/access-private-github-repos}{Accessing private GitHub repositories using Cloud Build (google article)} -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_mailgun.Rd b/man/cr_buildstep_mailgun.Rd index d846049d..634b82e8 100644 --- a/man/cr_buildstep_mailgun.Rd +++ b/man/cr_buildstep_mailgun.Rd @@ -4,15 +4,8 @@ \alias{cr_buildstep_mailgun} \title{Send an email in a Cloud Build step via MailGun.org} \usage{ -cr_buildstep_mailgun( - message, - to, - subject, - from, - mailgun_url = "$_MAILGUN_URL", - mailgun_key = "$_MAILGUN_KEY", - ... -) +cr_buildstep_mailgun(message, to, subject, from, + mailgun_url = "$_MAILGUN_URL", mailgun_key = "$_MAILGUN_KEY", ...) } \arguments{ \item{message}{The message markdown} @@ -56,19 +49,18 @@ cr_build( } } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_nginx_setup.Rd b/man/cr_buildstep_nginx_setup.Rd index 975fa681..0f95aac6 100644 --- a/man/cr_buildstep_nginx_setup.Rd +++ b/man/cr_buildstep_nginx_setup.Rd @@ -30,19 +30,18 @@ cr_build_yaml( ) } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_pkgdown.Rd b/man/cr_buildstep_pkgdown.Rd index 3e79485a..f2ec7432 100644 --- a/man/cr_buildstep_pkgdown.Rd +++ b/man/cr_buildstep_pkgdown.Rd @@ -4,15 +4,9 @@ \alias{cr_buildstep_pkgdown} \title{Create buildsteps for deploying an R pkgdown website to GitHub} \usage{ -cr_buildstep_pkgdown( - github_repo, - git_email, - keyring = "my-keyring", - key = "github-key", - env = NULL, - cipher = "id_rsa.enc", - build_image = "gcr.io/gcer-public/packagetools:master" -) +cr_buildstep_pkgdown(github_repo, git_email, keyring = "my-keyring", + key = "github-key", env = NULL, cipher = "id_rsa.enc", + build_image = "gcr.io/gcer-public/packagetools:master") } \arguments{ \item{github_repo}{The GitHub repo to deploy pkgdown website from and to.} @@ -50,19 +44,18 @@ my_source <- cr_build_source(RepoSource("my_repo", branch="master")) build <- cr_build_make(build_yaml, source = my_source) } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_r.Rd b/man/cr_buildstep_r.Rd index c08f6b6b..bb93df92 100644 --- a/man/cr_buildstep_r.Rd +++ b/man/cr_buildstep_r.Rd @@ -4,13 +4,8 @@ \alias{cr_buildstep_r} \title{Run an R script in a Cloud Build R step} \usage{ -cr_buildstep_r( - r, - name = "r-base", - r_source = c("local", "runtime"), - prefix = "rocker/", - ... -) +cr_buildstep_r(r, name = "r-base", r_source = c("local", "runtime"), + prefix = "rocker/", ...) } \arguments{ \item{r}{R code to run or a file containing R code ending with .R} @@ -60,19 +55,18 @@ br <- cr_buildstep_r(my_r, name= "gcr.io/gcer-public/packagetools:master") } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_run.Rd b/man/cr_buildstep_run.Rd index 033448a8..36c7d584 100644 --- a/man/cr_buildstep_run.Rd +++ b/man/cr_buildstep_run.Rd @@ -4,14 +4,8 @@ \alias{cr_buildstep_run} \title{Create buildsteps to deploy to Cloud Run} \usage{ -cr_buildstep_run( - name, - image, - allowUnauthenticated = TRUE, - region = cr_region_get(), - concurrency = 80, - ... -) +cr_buildstep_run(name, image, allowUnauthenticated = TRUE, + region = cr_region_get(), concurrency = 80, ...) } \arguments{ \item{name}{Name for deployment on Cloud Run} @@ -30,19 +24,18 @@ cr_buildstep_run( Create buildsteps to deploy to Cloud Run } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep_slack}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_r}}, + \code{\link{cr_buildstep_slack}}, + \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildstep_slack.Rd b/man/cr_buildstep_slack.Rd index 3e0b3244..bf1d24f0 100644 --- a/man/cr_buildstep_slack.Rd +++ b/man/cr_buildstep_slack.Rd @@ -4,15 +4,9 @@ \alias{cr_buildstep_slack} \title{Send a Slack message to a channel from a Cloud Build step} \usage{ -cr_buildstep_slack( - message, - title = "CloudBuild - $BUILD_ID", - channel = NULL, - username = "googleCloudRunnerBot", - webhook = "$_SLACK_WEBHOOK", - icon = NULL, - colour = "#efefef" -) +cr_buildstep_slack(message, title = "CloudBuild - $BUILD_ID", + channel = NULL, username = "googleCloudRunnerBot", + webhook = "$_SLACK_WEBHOOK", icon = NULL, colour = "#efefef") } \arguments{ \item{message}{The body of the message} @@ -53,19 +47,17 @@ cr_build(bs, substitutions = list(`_SLACK_WEBHOOK` = webhook)) } \seealso{ -Other Cloud Buildsteps: -\code{\link{cr_buildstep_bash}()}, -\code{\link{cr_buildstep_decrypt}()}, -\code{\link{cr_buildstep_df}()}, -\code{\link{cr_buildstep_docker}()}, -\code{\link{cr_buildstep_edit}()}, -\code{\link{cr_buildstep_extract}()}, -\code{\link{cr_buildstep_gitsetup}()}, -\code{\link{cr_buildstep_mailgun}()}, -\code{\link{cr_buildstep_nginx_setup}()}, -\code{\link{cr_buildstep_pkgdown}()}, -\code{\link{cr_buildstep_run}()}, -\code{\link{cr_buildstep_r}()}, -\code{\link{cr_buildstep}()} +Other Cloud Buildsteps: \code{\link{cr_buildstep_bash}}, + \code{\link{cr_buildstep_decrypt}}, + \code{\link{cr_buildstep_df}}, + \code{\link{cr_buildstep_docker}}, + \code{\link{cr_buildstep_edit}}, + \code{\link{cr_buildstep_extract}}, + \code{\link{cr_buildstep_gitsetup}}, + \code{\link{cr_buildstep_mailgun}}, + \code{\link{cr_buildstep_nginx_setup}}, + \code{\link{cr_buildstep_pkgdown}}, + \code{\link{cr_buildstep_run}}, + \code{\link{cr_buildstep_r}}, \code{\link{cr_buildstep}} } \concept{Cloud Buildsteps} diff --git a/man/cr_buildtrigger.Rd b/man/cr_buildtrigger.Rd index aaaf5ac6..ee9667c5 100644 --- a/man/cr_buildtrigger.Rd +++ b/man/cr_buildtrigger.Rd @@ -4,18 +4,10 @@ \alias{cr_buildtrigger} \title{Creates a new `BuildTrigger`.This API is experimental.} \usage{ -cr_buildtrigger( - name, - trigger, - build, - description = paste("cr_buildtrigger: ", Sys.time()), - tags = NULL, - disabled = FALSE, - substitutions = NULL, - ignoredFiles = NULL, - includedFiles = NULL, - projectId = cr_project_get() -) +cr_buildtrigger(name, trigger, build, + description = paste("cr_buildtrigger: ", Sys.time()), tags = NULL, + disabled = FALSE, substitutions = NULL, ignoredFiles = NULL, + includedFiles = NULL, projectId = cr_project_get()) } \arguments{ \item{name}{User assigned name of the trigger} @@ -76,14 +68,13 @@ cr_buildtrigger("trig4", trigger = github, } } \seealso{ -Other BuildTrigger functions: -\code{\link{BuildTrigger}()}, -\code{\link{GitHubEventsConfig}()}, -\code{\link{cr_buildtrigger_delete}()}, -\code{\link{cr_buildtrigger_edit}()}, -\code{\link{cr_buildtrigger_get}()}, -\code{\link{cr_buildtrigger_list}()}, -\code{\link{cr_buildtrigger_make}()}, -\code{\link{cr_buildtrigger_run}()} +Other BuildTrigger functions: \code{\link{BuildTrigger}}, + \code{\link{GitHubEventsConfig}}, + \code{\link{cr_buildtrigger_delete}}, + \code{\link{cr_buildtrigger_edit}}, + \code{\link{cr_buildtrigger_get}}, + \code{\link{cr_buildtrigger_list}}, + \code{\link{cr_buildtrigger_make}}, + \code{\link{cr_buildtrigger_run}} } \concept{BuildTrigger functions} diff --git a/man/cr_buildtrigger_delete.Rd b/man/cr_buildtrigger_delete.Rd index 002e517d..8c5046fd 100644 --- a/man/cr_buildtrigger_delete.Rd +++ b/man/cr_buildtrigger_delete.Rd @@ -15,14 +15,13 @@ cr_buildtrigger_delete(triggerId, projectId = cr_project_get()) Deletes a `BuildTrigger` by its project ID and trigger ID.This API is experimental. } \seealso{ -Other BuildTrigger functions: -\code{\link{BuildTrigger}()}, -\code{\link{GitHubEventsConfig}()}, -\code{\link{cr_buildtrigger_edit}()}, -\code{\link{cr_buildtrigger_get}()}, -\code{\link{cr_buildtrigger_list}()}, -\code{\link{cr_buildtrigger_make}()}, -\code{\link{cr_buildtrigger_run}()}, -\code{\link{cr_buildtrigger}()} +Other BuildTrigger functions: \code{\link{BuildTrigger}}, + \code{\link{GitHubEventsConfig}}, + \code{\link{cr_buildtrigger_edit}}, + \code{\link{cr_buildtrigger_get}}, + \code{\link{cr_buildtrigger_list}}, + \code{\link{cr_buildtrigger_make}}, + \code{\link{cr_buildtrigger_run}}, + \code{\link{cr_buildtrigger}} } \concept{BuildTrigger functions} diff --git a/man/cr_buildtrigger_edit.Rd b/man/cr_buildtrigger_edit.Rd index 35f8b1f5..9481ee13 100644 --- a/man/cr_buildtrigger_edit.Rd +++ b/man/cr_buildtrigger_edit.Rd @@ -4,7 +4,8 @@ \alias{cr_buildtrigger_edit} \title{Updates a `BuildTrigger` by its project ID and trigger ID.This API is experimental.} \usage{ -cr_buildtrigger_edit(BuildTrigger, triggerId, projectId = cr_project_get()) +cr_buildtrigger_edit(BuildTrigger, triggerId, + projectId = cr_project_get()) } \arguments{ \item{BuildTrigger}{The \link{BuildTrigger} object to update to} @@ -39,14 +40,13 @@ edited <- cr_buildtrigger_edit(bt3, triggerId = bt2) } \seealso{ -Other BuildTrigger functions: -\code{\link{BuildTrigger}()}, -\code{\link{GitHubEventsConfig}()}, -\code{\link{cr_buildtrigger_delete}()}, -\code{\link{cr_buildtrigger_get}()}, -\code{\link{cr_buildtrigger_list}()}, -\code{\link{cr_buildtrigger_make}()}, -\code{\link{cr_buildtrigger_run}()}, -\code{\link{cr_buildtrigger}()} +Other BuildTrigger functions: \code{\link{BuildTrigger}}, + \code{\link{GitHubEventsConfig}}, + \code{\link{cr_buildtrigger_delete}}, + \code{\link{cr_buildtrigger_get}}, + \code{\link{cr_buildtrigger_list}}, + \code{\link{cr_buildtrigger_make}}, + \code{\link{cr_buildtrigger_run}}, + \code{\link{cr_buildtrigger}} } \concept{BuildTrigger functions} diff --git a/man/cr_buildtrigger_get.Rd b/man/cr_buildtrigger_get.Rd index 771150a9..85b6e08f 100644 --- a/man/cr_buildtrigger_get.Rd +++ b/man/cr_buildtrigger_get.Rd @@ -15,14 +15,13 @@ cr_buildtrigger_get(triggerId, projectId = cr_project_get()) Returns information about a `BuildTrigger`.This API is experimental. } \seealso{ -Other BuildTrigger functions: -\code{\link{BuildTrigger}()}, -\code{\link{GitHubEventsConfig}()}, -\code{\link{cr_buildtrigger_delete}()}, -\code{\link{cr_buildtrigger_edit}()}, -\code{\link{cr_buildtrigger_list}()}, -\code{\link{cr_buildtrigger_make}()}, -\code{\link{cr_buildtrigger_run}()}, -\code{\link{cr_buildtrigger}()} +Other BuildTrigger functions: \code{\link{BuildTrigger}}, + \code{\link{GitHubEventsConfig}}, + \code{\link{cr_buildtrigger_delete}}, + \code{\link{cr_buildtrigger_edit}}, + \code{\link{cr_buildtrigger_list}}, + \code{\link{cr_buildtrigger_make}}, + \code{\link{cr_buildtrigger_run}}, + \code{\link{cr_buildtrigger}} } \concept{BuildTrigger functions} diff --git a/man/cr_buildtrigger_list.Rd b/man/cr_buildtrigger_list.Rd index b17b93d9..2a06031d 100644 --- a/man/cr_buildtrigger_list.Rd +++ b/man/cr_buildtrigger_list.Rd @@ -13,14 +13,13 @@ cr_buildtrigger_list(projectId = cr_project_get()) Lists existing `BuildTrigger`s.This API is experimental. } \seealso{ -Other BuildTrigger functions: -\code{\link{BuildTrigger}()}, -\code{\link{GitHubEventsConfig}()}, -\code{\link{cr_buildtrigger_delete}()}, -\code{\link{cr_buildtrigger_edit}()}, -\code{\link{cr_buildtrigger_get}()}, -\code{\link{cr_buildtrigger_make}()}, -\code{\link{cr_buildtrigger_run}()}, -\code{\link{cr_buildtrigger}()} +Other BuildTrigger functions: \code{\link{BuildTrigger}}, + \code{\link{GitHubEventsConfig}}, + \code{\link{cr_buildtrigger_delete}}, + \code{\link{cr_buildtrigger_edit}}, + \code{\link{cr_buildtrigger_get}}, + \code{\link{cr_buildtrigger_make}}, + \code{\link{cr_buildtrigger_run}}, + \code{\link{cr_buildtrigger}} } \concept{BuildTrigger functions} diff --git a/man/cr_buildtrigger_make.Rd b/man/cr_buildtrigger_make.Rd index 4cd50f37..12a17309 100644 --- a/man/cr_buildtrigger_make.Rd +++ b/man/cr_buildtrigger_make.Rd @@ -7,33 +7,31 @@ cr_buildtrigger_make(...) } \arguments{ -\item{...}{ - Arguments passed on to \code{\link[=cr_buildtrigger]{cr_buildtrigger}} - \describe{ - \item{\code{trigger}}{The trigger source which will be a \link{RepoSource} or a \link{GitHubEventsConfig}} - \item{\code{build}}{A file location within the trigger source to use for the build steps, or a \link{Build} object} - \item{\code{projectId}}{ID of the project for which to configure automatic builds} - \item{\code{name}}{User assigned name of the trigger} - \item{\code{description}}{Human-readable description of this trigger} - \item{\code{tags}}{Tags for annotation of a `BuildTrigger`} - \item{\code{disabled}}{If true, the trigger will never result in a build} - \item{\code{substitutions}}{A named list of Build macro variables} - \item{\code{ignoredFiles}}{ignored_files and included_files are file glob matches extended with support for "**".} - \item{\code{includedFiles}}{If any of the files altered in the commit pass the ignored_files} - }} +\item{...}{Arguments passed on to \code{cr_buildtrigger} +\describe{ + \item{trigger}{The trigger source which will be a \link{RepoSource} or a \link{GitHubEventsConfig}} + \item{build}{A file location within the trigger source to use for the build steps, or a \link{Build} object} + \item{projectId}{ID of the project for which to configure automatic builds} + \item{name}{User assigned name of the trigger} + \item{description}{Human-readable description of this trigger} + \item{tags}{Tags for annotation of a `BuildTrigger`} + \item{disabled}{If true, the trigger will never result in a build} + \item{substitutions}{A named list of Build macro variables} + \item{ignoredFiles}{ignored_files and included_files are file glob matches extended with support for "**".} + \item{includedFiles}{If any of the files altered in the commit pass the ignored_files} +}} } \description{ Create a buildtrigger object } \seealso{ -Other BuildTrigger functions: -\code{\link{BuildTrigger}()}, -\code{\link{GitHubEventsConfig}()}, -\code{\link{cr_buildtrigger_delete}()}, -\code{\link{cr_buildtrigger_edit}()}, -\code{\link{cr_buildtrigger_get}()}, -\code{\link{cr_buildtrigger_list}()}, -\code{\link{cr_buildtrigger_run}()}, -\code{\link{cr_buildtrigger}()} +Other BuildTrigger functions: \code{\link{BuildTrigger}}, + \code{\link{GitHubEventsConfig}}, + \code{\link{cr_buildtrigger_delete}}, + \code{\link{cr_buildtrigger_edit}}, + \code{\link{cr_buildtrigger_get}}, + \code{\link{cr_buildtrigger_list}}, + \code{\link{cr_buildtrigger_run}}, + \code{\link{cr_buildtrigger}} } \concept{BuildTrigger functions} diff --git a/man/cr_buildtrigger_run.Rd b/man/cr_buildtrigger_run.Rd index f539f962..eda5b62a 100644 --- a/man/cr_buildtrigger_run.Rd +++ b/man/cr_buildtrigger_run.Rd @@ -17,14 +17,13 @@ cr_buildtrigger_run(triggerId, RepoSource, projectId = cr_project_get()) Runs a `BuildTrigger` at a particular source revision. } \seealso{ -Other BuildTrigger functions: -\code{\link{BuildTrigger}()}, -\code{\link{GitHubEventsConfig}()}, -\code{\link{cr_buildtrigger_delete}()}, -\code{\link{cr_buildtrigger_edit}()}, -\code{\link{cr_buildtrigger_get}()}, -\code{\link{cr_buildtrigger_list}()}, -\code{\link{cr_buildtrigger_make}()}, -\code{\link{cr_buildtrigger}()} +Other BuildTrigger functions: \code{\link{BuildTrigger}}, + \code{\link{GitHubEventsConfig}}, + \code{\link{cr_buildtrigger_delete}}, + \code{\link{cr_buildtrigger_edit}}, + \code{\link{cr_buildtrigger_get}}, + \code{\link{cr_buildtrigger_list}}, + \code{\link{cr_buildtrigger_make}}, + \code{\link{cr_buildtrigger}} } \concept{BuildTrigger functions} diff --git a/man/cr_deploy_docker.Rd b/man/cr_deploy_docker.Rd index 65f38757..f855eab9 100644 --- a/man/cr_deploy_docker.Rd +++ b/man/cr_deploy_docker.Rd @@ -4,17 +4,10 @@ \alias{cr_deploy_docker} \title{Deploy a local Dockerfile to be built on ContainerRegistry} \usage{ -cr_deploy_docker( - local, - image_name = remote, - dockerfile = NULL, - remote = basename(local), - tag = "$BUILD_ID", - timeout = 600L, - bucket = cr_bucket_get(), - projectId = cr_project_get(), - launch_browser = interactive() -) +cr_deploy_docker(local, image_name = remote, dockerfile = NULL, + remote = basename(local), tag = "$BUILD_ID", timeout = 600L, + bucket = cr_bucket_get(), projectId = cr_project_get(), + launch_browser = interactive()) } \arguments{ \item{local}{The folder containing the Dockerfile to build} @@ -52,11 +45,9 @@ b <- cr_deploy_docker(system.file("example/", package="googleCloudRunner")) } } \seealso{ -Other Deployment functions: -\code{\link{cr_deploy_git_html}()}, -\code{\link{cr_deploy_github_docker}()}, -\code{\link{cr_deploy_pkgdown}()}, -\code{\link{cr_deploy_run}()}, -\code{\link{cr_deploy_r}()} +Other Deployment functions: \code{\link{cr_deploy_git_html}}, + \code{\link{cr_deploy_github_docker}}, + \code{\link{cr_deploy_pkgdown}}, + \code{\link{cr_deploy_run}}, \code{\link{cr_deploy_r}} } \concept{Deployment functions} diff --git a/man/cr_deploy_git_html.Rd b/man/cr_deploy_git_html.Rd index 62eeb721..8518a930 100644 --- a/man/cr_deploy_git_html.Rd +++ b/man/cr_deploy_git_html.Rd @@ -4,21 +4,12 @@ \alias{cr_deploy_git_html} \title{Deploy HTML built from a repo each commit (Experimental)} \usage{ -cr_deploy_git_html( - x, - image = paste0(x, "-html"), - rmd_folder = NULL, - html_folder = NULL, - branch = ".*", - image_tag = "$SHORT_SHA", - github_tag = NULL, - timeout = 600L, - edit_r = NULL, +cr_deploy_git_html(x, image = paste0(x, "-html"), rmd_folder = NULL, + html_folder = NULL, branch = ".*", image_tag = "$SHORT_SHA", + github_tag = NULL, timeout = 600L, edit_r = NULL, r_image = "gcr.io/gcer-public/packagetools:master", - allowUnauthenticated = TRUE, - region = cr_region_get(), - projectId = cr_project_get() -) + allowUnauthenticated = TRUE, region = cr_region_get(), + projectId = cr_project_get()) } \arguments{ \item{x}{The GitHub repo e.g. \code{MarkEdmondson1234/googleCloudRunner}} @@ -79,11 +70,9 @@ cr_deploy_git_html(your_repo, \seealso{ \link{cr_deploy_html} that lets you deploy HTML files -Other Deployment functions: -\code{\link{cr_deploy_docker}()}, -\code{\link{cr_deploy_github_docker}()}, -\code{\link{cr_deploy_pkgdown}()}, -\code{\link{cr_deploy_run}()}, -\code{\link{cr_deploy_r}()} +Other Deployment functions: \code{\link{cr_deploy_docker}}, + \code{\link{cr_deploy_github_docker}}, + \code{\link{cr_deploy_pkgdown}}, + \code{\link{cr_deploy_run}}, \code{\link{cr_deploy_r}} } \concept{Deployment functions} diff --git a/man/cr_deploy_github_docker.Rd b/man/cr_deploy_github_docker.Rd index 2ab1d65a..d68529d3 100644 --- a/man/cr_deploy_github_docker.Rd +++ b/man/cr_deploy_github_docker.Rd @@ -4,16 +4,9 @@ \alias{cr_deploy_github_docker} \title{Deploy Docker build from a GitHub repo (Experimental)} \usage{ -cr_deploy_github_docker( - x, - image = x, - branch = ".*", - image_tag = "$SHORT_SHA", - dockerfile_location = ".", - github_tag = NULL, - timeout = 600L, - projectId = cr_project_get() -) +cr_deploy_github_docker(x, image = x, branch = ".*", + image_tag = "$SHORT_SHA", dockerfile_location = ".", + github_tag = NULL, timeout = 600L, projectId = cr_project_get()) } \arguments{ \item{x}{The GitHub repo e.g. \code{MarkEdmondson1234/googleCloudRunner}} @@ -41,11 +34,9 @@ Build trigger API is experimental so this function is in development. \seealso{ \link{cr_deploy_docker} which lets you build Dockerfiles for more generic use cases -Other Deployment functions: -\code{\link{cr_deploy_docker}()}, -\code{\link{cr_deploy_git_html}()}, -\code{\link{cr_deploy_pkgdown}()}, -\code{\link{cr_deploy_run}()}, -\code{\link{cr_deploy_r}()} +Other Deployment functions: \code{\link{cr_deploy_docker}}, + \code{\link{cr_deploy_git_html}}, + \code{\link{cr_deploy_pkgdown}}, + \code{\link{cr_deploy_run}}, \code{\link{cr_deploy_r}} } \concept{Deployment functions} diff --git a/man/cr_deploy_pkgdown.Rd b/man/cr_deploy_pkgdown.Rd index df94fd4d..af6e2b82 100644 --- a/man/cr_deploy_pkgdown.Rd +++ b/man/cr_deploy_pkgdown.Rd @@ -4,16 +4,10 @@ \alias{cr_deploy_pkgdown} \title{Deploy a cloudbuild.yml for a pkgdown website of an R package} \usage{ -cr_deploy_pkgdown( - steps = NULL, - cloudbuild_file = "cloudbuild.yml", - git_email = "googlecloudrunner@r.com", - keyring = "my-keyring", - key = "github-key", - env = NULL, - cipher = "id_rsa.enc", - build_image = "gcr.io/gcer-public/packagetools:master" -) +cr_deploy_pkgdown(steps = NULL, cloudbuild_file = "cloudbuild.yml", + git_email = "googlecloudrunner@r.com", keyring = "my-keyring", + key = "github-key", env = NULL, cipher = "id_rsa.enc", + build_image = "gcr.io/gcer-public/packagetools:master") } \arguments{ \item{steps}{extra steps to run before the pkgdown website steps run} @@ -50,11 +44,9 @@ pd \seealso{ Create your own custom deployment using \link{cr_buildstep_pkgdown} which this function uses with some defaults -Other Deployment functions: -\code{\link{cr_deploy_docker}()}, -\code{\link{cr_deploy_git_html}()}, -\code{\link{cr_deploy_github_docker}()}, -\code{\link{cr_deploy_run}()}, -\code{\link{cr_deploy_r}()} +Other Deployment functions: \code{\link{cr_deploy_docker}}, + \code{\link{cr_deploy_git_html}}, + \code{\link{cr_deploy_github_docker}}, + \code{\link{cr_deploy_run}}, \code{\link{cr_deploy_r}} } \concept{Deployment functions} diff --git a/man/cr_deploy_r.Rd b/man/cr_deploy_r.Rd index d3bf45c9..bc98fa54 100644 --- a/man/cr_deploy_r.Rd +++ b/man/cr_deploy_r.Rd @@ -4,20 +4,10 @@ \alias{cr_deploy_r} \title{Deploy an R script with an optional schedule} \usage{ -cr_deploy_r( - r, - schedule = NULL, - source = NULL, - run_name = NULL, - r_image = "rocker/verse", - pre_steps = NULL, - post_steps = NULL, - timeout = 600L, - email = cr_email_get(), - region = cr_region_get(), - projectId = cr_project_get(), - launch_browser = interactive() -) +cr_deploy_r(r, schedule = NULL, source = NULL, run_name = NULL, + r_image = "rocker/verse", pre_steps = NULL, post_steps = NULL, + timeout = 600L, email = cr_email_get(), region = cr_region_get(), + projectId = cr_project_get(), launch_browser = interactive()) } \arguments{ \item{r}{R code to run or a file containing R code ending with .R} @@ -80,11 +70,10 @@ cr_deploy_r(r_lines, schedule = "15 21 * * *", source = source) \seealso{ If you want to run R code upon certain events like GitHub pushes, look at \link{cr_buildtrigger} -Other Deployment functions: -\code{\link{cr_deploy_docker}()}, -\code{\link{cr_deploy_git_html}()}, -\code{\link{cr_deploy_github_docker}()}, -\code{\link{cr_deploy_pkgdown}()}, -\code{\link{cr_deploy_run}()} +Other Deployment functions: \code{\link{cr_deploy_docker}}, + \code{\link{cr_deploy_git_html}}, + \code{\link{cr_deploy_github_docker}}, + \code{\link{cr_deploy_pkgdown}}, + \code{\link{cr_deploy_run}} } \concept{Deployment functions} diff --git a/man/cr_deploy_run.Rd b/man/cr_deploy_run.Rd index b503878d..5c39e8d5 100644 --- a/man/cr_deploy_run.Rd +++ b/man/cr_deploy_run.Rd @@ -6,43 +6,20 @@ \alias{cr_deploy_plumber} \title{Deploy to Cloud Run} \usage{ -cr_deploy_run( - local, - remote = basename(local), - dockerfile = NULL, - image_name = remote, - tag = "$BUILD_ID", - region = cr_region_get(), - bucket = cr_bucket_get(), - projectId = cr_project_get(), - launch_browser = interactive(), - timeout = 600L -) - -cr_deploy_html( - html_folder, - remote = basename(html_folder), - image_name = remote, - tag = "$BUILD_ID", - region = cr_region_get(), - bucket = cr_bucket_get(), - projectId = cr_project_get(), - launch_browser = interactive(), - timeout = 600L -) - -cr_deploy_plumber( - api, - remote = basename(api), - dockerfile = NULL, - image_name = remote, - tag = "$BUILD_ID", - region = cr_region_get(), - bucket = cr_bucket_get(), - projectId = cr_project_get(), - launch_browser = interactive(), - timeout = 600L -) +cr_deploy_run(local, remote = basename(local), dockerfile = NULL, + image_name = remote, tag = "$BUILD_ID", region = cr_region_get(), + bucket = cr_bucket_get(), projectId = cr_project_get(), + launch_browser = interactive(), timeout = 600L) + +cr_deploy_html(html_folder, remote = basename(html_folder), + image_name = remote, tag = "$BUILD_ID", region = cr_region_get(), + bucket = cr_bucket_get(), projectId = cr_project_get(), + launch_browser = interactive(), timeout = 600L) + +cr_deploy_plumber(api, remote = basename(api), dockerfile = NULL, + image_name = remote, tag = "$BUILD_ID", region = cr_region_get(), + bucket = cr_bucket_get(), projectId = cr_project_get(), + launch_browser = interactive(), timeout = 600L) } \arguments{ \item{local}{A folder containing the scripts and Dockerfile to deploy to Cloud Run} @@ -73,7 +50,7 @@ cr_deploy_plumber( Deploy R api plumber scripts, HTML files or other images create the Docker image, add the build to Cloud Build and deploy to Cloud Run } \details{ - +These deploy containers to Cloud Run, a scale 0-to-millions container-as-a-service on Google Cloud Platform. @@ -120,11 +97,10 @@ cr_deploy_plumber(system.file("example/", package = "googleCloudRunner")) } } \seealso{ -Other Deployment functions: -\code{\link{cr_deploy_docker}()}, -\code{\link{cr_deploy_git_html}()}, -\code{\link{cr_deploy_github_docker}()}, -\code{\link{cr_deploy_pkgdown}()}, -\code{\link{cr_deploy_r}()} +Other Deployment functions: \code{\link{cr_deploy_docker}}, + \code{\link{cr_deploy_git_html}}, + \code{\link{cr_deploy_github_docker}}, + \code{\link{cr_deploy_pkgdown}}, + \code{\link{cr_deploy_r}} } \concept{Deployment functions} diff --git a/man/cr_plumber_pubsub.Rd b/man/cr_plumber_pubsub.Rd index e80e7067..1d9f5257 100644 --- a/man/cr_plumber_pubsub.Rd +++ b/man/cr_plumber_pubsub.Rd @@ -44,9 +44,7 @@ function(message=NULL){ \seealso{ \href{https://cloud.google.com/run/docs/tutorials/pubsub}{Google Pub/Sub tutorial for Cloud Run} -Other Cloud Run functions: -\code{\link{cr_run_get}()}, -\code{\link{cr_run_list}()}, -\code{\link{cr_run}()} +Other Cloud Run functions: \code{\link{cr_run_get}}, + \code{\link{cr_run_list}}, \code{\link{cr_run}} } \concept{Cloud Run functions} diff --git a/man/cr_region_set.Rd b/man/cr_region_set.Rd index 2c631471..7cfcc216 100644 --- a/man/cr_region_set.Rd +++ b/man/cr_region_set.Rd @@ -5,9 +5,8 @@ \alias{cr_region_get} \title{Get/Set the endpoint for your CloudRun services} \usage{ -cr_region_set( - region = c("europe-west1", "us-central1", "asia-northeast1", "us-east1") -) +cr_region_set(region = c("europe-west1", "us-central1", + "asia-northeast1", "us-east1")) cr_region_get() } diff --git a/man/cr_run.Rd b/man/cr_run.Rd index 0ffb4d44..2b4528eb 100644 --- a/man/cr_run.Rd +++ b/man/cr_run.Rd @@ -4,16 +4,9 @@ \alias{cr_run} \title{Create a CloudRun service.} \usage{ -cr_run( - image, - name = basename(image), - allowUnauthenticated = TRUE, - concurrency = 1, - timeout = 600L, - region = cr_region_get(), - projectId = cr_project_get(), - launch_browser = interactive() -) +cr_run(image, name = basename(image), allowUnauthenticated = TRUE, + concurrency = 1, timeout = 600L, region = cr_region_get(), + projectId = cr_project_get(), launch_browser = interactive()) } \arguments{ \item{image}{The name of the image to create or use in deployment - \code{gcr.io}} @@ -51,9 +44,7 @@ Use \link{cr_deploy_docker} or similar to create image, \link{cr_deploy_run} to \href{https://cloud.google.com/cloud-build/docs/deploying-builds/deploy-cloud-run}{Deploying Cloud Run using Cloud Build} -Other Cloud Run functions: -\code{\link{cr_plumber_pubsub}()}, -\code{\link{cr_run_get}()}, -\code{\link{cr_run_list}()} +Other Cloud Run functions: \code{\link{cr_plumber_pubsub}}, + \code{\link{cr_run_get}}, \code{\link{cr_run_list}} } \concept{Cloud Run functions} diff --git a/man/cr_run_get.Rd b/man/cr_run_get.Rd index 22c308db..fe89c81b 100644 --- a/man/cr_run_get.Rd +++ b/man/cr_run_get.Rd @@ -20,9 +20,7 @@ This returns details on a particular deployed Cloud Run service. \seealso{ \href{https://cloud.google.com/run/docs/reference/rest/v1/namespaces.services/get}{Google Documentation on namespaces.services.get} -Other Cloud Run functions: -\code{\link{cr_plumber_pubsub}()}, -\code{\link{cr_run_list}()}, -\code{\link{cr_run}()} +Other Cloud Run functions: \code{\link{cr_plumber_pubsub}}, + \code{\link{cr_run_list}}, \code{\link{cr_run}} } \concept{Cloud Run functions} diff --git a/man/cr_run_list.Rd b/man/cr_run_list.Rd index 92109af4..9e7d271c 100644 --- a/man/cr_run_list.Rd +++ b/man/cr_run_list.Rd @@ -4,12 +4,8 @@ \alias{cr_run_list} \title{List CloudRun services.} \usage{ -cr_run_list( - projectId = cr_project_get(), - labelSelector = NULL, - limit = NULL, - summary = TRUE -) +cr_run_list(projectId = cr_project_get(), labelSelector = NULL, + limit = NULL, summary = TRUE) } \arguments{ \item{projectId}{The GCP project from which the services should be listed} @@ -26,9 +22,7 @@ List the Cloud Run services you have access to \seealso{ \href{https://cloud.run}{Google Documentation for Cloud Run} -Other Cloud Run functions: -\code{\link{cr_plumber_pubsub}()}, -\code{\link{cr_run_get}()}, -\code{\link{cr_run}()} +Other Cloud Run functions: \code{\link{cr_plumber_pubsub}}, + \code{\link{cr_run_get}}, \code{\link{cr_run}} } \concept{Cloud Run functions} diff --git a/man/cr_schedule.Rd b/man/cr_schedule.Rd index 598ab26a..f084a182 100644 --- a/man/cr_schedule.Rd +++ b/man/cr_schedule.Rd @@ -4,15 +4,9 @@ \alias{cr_schedule} \title{Creates or updates a Cloud Scheduler job.} \usage{ -cr_schedule( - name, - schedule = NULL, - httpTarget = NULL, - description = NULL, - overwrite = FALSE, - region = cr_region_get(), - projectId = cr_project_get() -) +cr_schedule(name, schedule = NULL, httpTarget = NULL, + description = NULL, overwrite = FALSE, region = cr_region_get(), + projectId = cr_project_get()) } \arguments{ \item{name}{Optionally caller-specified in CreateJob, after} @@ -57,13 +51,11 @@ cr_schedule("cloud-build-test2", "12 6 * * *", overwrite=TRUE) \seealso{ \href{https://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs/create}{Google Documentation for Cloud Scheduler} -Other Cloud Scheduler functions: -\code{\link{HttpTarget}()}, -\code{\link{Job}()}, -\code{\link{cr_schedule_delete}()}, -\code{\link{cr_schedule_get}()}, -\code{\link{cr_schedule_list}()}, -\code{\link{cr_schedule_pause}()}, -\code{\link{cr_schedule_run}()} +Other Cloud Scheduler functions: \code{\link{HttpTarget}}, + \code{\link{Job}}, \code{\link{cr_schedule_delete}}, + \code{\link{cr_schedule_get}}, + \code{\link{cr_schedule_list}}, + \code{\link{cr_schedule_pause}}, + \code{\link{cr_schedule_run}} } \concept{Cloud Scheduler functions} diff --git a/man/cr_schedule_delete.Rd b/man/cr_schedule_delete.Rd index 3ef0a859..1c5c8604 100644 --- a/man/cr_schedule_delete.Rd +++ b/man/cr_schedule_delete.Rd @@ -4,7 +4,8 @@ \alias{cr_schedule_delete} \title{Deletes a scheduled job.} \usage{ -cr_schedule_delete(x, region = cr_region_get(), projectId = cr_project_get()) +cr_schedule_delete(x, region = cr_region_get(), + projectId = cr_project_get()) } \arguments{ \item{x}{The name of the scheduled job or a \link{Job} object} @@ -26,13 +27,10 @@ cr_schedule_delete("cloud-build-test1") \seealso{ \href{https://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs/delete}{cloudscheduler.projects.locations.jobs.delete} -Other Cloud Scheduler functions: -\code{\link{HttpTarget}()}, -\code{\link{Job}()}, -\code{\link{cr_schedule_get}()}, -\code{\link{cr_schedule_list}()}, -\code{\link{cr_schedule_pause}()}, -\code{\link{cr_schedule_run}()}, -\code{\link{cr_schedule}()} +Other Cloud Scheduler functions: \code{\link{HttpTarget}}, + \code{\link{Job}}, \code{\link{cr_schedule_get}}, + \code{\link{cr_schedule_list}}, + \code{\link{cr_schedule_pause}}, + \code{\link{cr_schedule_run}}, \code{\link{cr_schedule}} } \concept{Cloud Scheduler functions} diff --git a/man/cr_schedule_get.Rd b/man/cr_schedule_get.Rd index 8c2e25a8..aa137f96 100644 --- a/man/cr_schedule_get.Rd +++ b/man/cr_schedule_get.Rd @@ -4,7 +4,8 @@ \alias{cr_schedule_get} \title{Gets a scheduler job.} \usage{ -cr_schedule_get(name, region = cr_region_get(), projectId = cr_project_get()) +cr_schedule_get(name, region = cr_region_get(), + projectId = cr_project_get()) } \arguments{ \item{name}{Required} @@ -26,13 +27,10 @@ cr_schedule_get("cloud-build-test1") \seealso{ \href{https://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs/get}{Google Documentation} -Other Cloud Scheduler functions: -\code{\link{HttpTarget}()}, -\code{\link{Job}()}, -\code{\link{cr_schedule_delete}()}, -\code{\link{cr_schedule_list}()}, -\code{\link{cr_schedule_pause}()}, -\code{\link{cr_schedule_run}()}, -\code{\link{cr_schedule}()} +Other Cloud Scheduler functions: \code{\link{HttpTarget}}, + \code{\link{Job}}, \code{\link{cr_schedule_delete}}, + \code{\link{cr_schedule_list}}, + \code{\link{cr_schedule_pause}}, + \code{\link{cr_schedule_run}}, \code{\link{cr_schedule}} } \concept{Cloud Scheduler functions} diff --git a/man/cr_schedule_list.Rd b/man/cr_schedule_list.Rd index b1aa1523..ce03c48b 100644 --- a/man/cr_schedule_list.Rd +++ b/man/cr_schedule_list.Rd @@ -4,7 +4,8 @@ \alias{cr_schedule_list} \title{Lists Cloud Scheduler jobs.} \usage{ -cr_schedule_list(region = cr_region_get(), projectId = cr_project_get()) +cr_schedule_list(region = cr_region_get(), + projectId = cr_project_get()) } \arguments{ \item{region}{The region to run within} @@ -25,13 +26,10 @@ cr_schedule_list() \seealso{ \href{https://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs/list}{Google Documentation} -Other Cloud Scheduler functions: -\code{\link{HttpTarget}()}, -\code{\link{Job}()}, -\code{\link{cr_schedule_delete}()}, -\code{\link{cr_schedule_get}()}, -\code{\link{cr_schedule_pause}()}, -\code{\link{cr_schedule_run}()}, -\code{\link{cr_schedule}()} +Other Cloud Scheduler functions: \code{\link{HttpTarget}}, + \code{\link{Job}}, \code{\link{cr_schedule_delete}}, + \code{\link{cr_schedule_get}}, + \code{\link{cr_schedule_pause}}, + \code{\link{cr_schedule_run}}, \code{\link{cr_schedule}} } \concept{Cloud Scheduler functions} diff --git a/man/cr_schedule_pause.Rd b/man/cr_schedule_pause.Rd index 05349242..66420fdd 100644 --- a/man/cr_schedule_pause.Rd +++ b/man/cr_schedule_pause.Rd @@ -5,9 +5,11 @@ \alias{cr_schedule_resume} \title{Pauses and resumes a scheduled job.} \usage{ -cr_schedule_pause(x, region = cr_region_get(), projectId = cr_project_get()) +cr_schedule_pause(x, region = cr_region_get(), + projectId = cr_project_get()) -cr_schedule_resume(x, region = cr_region_get(), projectId = cr_project_get()) +cr_schedule_resume(x, region = cr_region_get(), + projectId = cr_project_get()) } \arguments{ \item{x}{The name of the scheduled job or a \link{Job} object} @@ -35,13 +37,10 @@ cr_schedule_resume("cloud-build-test1") \href{https://cloud.google.com/scheduler/}{cloudscheduler.projects.locations.jobs.resume} -Other Cloud Scheduler functions: -\code{\link{HttpTarget}()}, -\code{\link{Job}()}, -\code{\link{cr_schedule_delete}()}, -\code{\link{cr_schedule_get}()}, -\code{\link{cr_schedule_list}()}, -\code{\link{cr_schedule_run}()}, -\code{\link{cr_schedule}()} +Other Cloud Scheduler functions: \code{\link{HttpTarget}}, + \code{\link{Job}}, \code{\link{cr_schedule_delete}}, + \code{\link{cr_schedule_get}}, + \code{\link{cr_schedule_list}}, + \code{\link{cr_schedule_run}}, \code{\link{cr_schedule}} } \concept{Cloud Scheduler functions} diff --git a/man/cr_schedule_run.Rd b/man/cr_schedule_run.Rd index 9e9d708c..992f8082 100644 --- a/man/cr_schedule_run.Rd +++ b/man/cr_schedule_run.Rd @@ -4,7 +4,8 @@ \alias{cr_schedule_run} \title{Forces a job to run now.} \usage{ -cr_schedule_run(x, region = cr_region_get(), projectId = cr_project_get()) +cr_schedule_run(x, region = cr_region_get(), + projectId = cr_project_get()) } \arguments{ \item{x}{The name of the scheduled job or a \link{Job} object} @@ -26,13 +27,11 @@ cr_schedule_run("cloud-build-test1") \seealso{ \href{https://cloud.google.com/scheduler/docs/reference/rest/v1/projects.locations.jobs/run}{cloudscheduler.projects.locations.jobs.run} -Other Cloud Scheduler functions: -\code{\link{HttpTarget}()}, -\code{\link{Job}()}, -\code{\link{cr_schedule_delete}()}, -\code{\link{cr_schedule_get}()}, -\code{\link{cr_schedule_list}()}, -\code{\link{cr_schedule_pause}()}, -\code{\link{cr_schedule}()} +Other Cloud Scheduler functions: \code{\link{HttpTarget}}, + \code{\link{Job}}, \code{\link{cr_schedule_delete}}, + \code{\link{cr_schedule_get}}, + \code{\link{cr_schedule_list}}, + \code{\link{cr_schedule_pause}}, + \code{\link{cr_schedule}} } \concept{Cloud Scheduler functions} diff --git a/man/googleCloudRunner.Rd b/man/googleCloudRunner.Rd index d90d6296..bc2f676e 100644 --- a/man/googleCloudRunner.Rd +++ b/man/googleCloudRunner.Rd @@ -3,6 +3,7 @@ \docType{package} \name{googleCloudRunner} \alias{googleCloudRunner} +\alias{googleCloudRunner-package} \title{Launch R scripts into the Google Cloud via Cloud Build, Cloud Run and Cloud Scheduler} \description{ Launch R scripts into the Google Cloud via Cloud Build, Cloud Run and Cloud Scheduler diff --git a/vignettes/cloudrun.Rmd b/vignettes/cloudrun.Rmd index db061f8f..fbb89958 100644 --- a/vignettes/cloudrun.Rmd +++ b/vignettes/cloudrun.Rmd @@ -17,7 +17,18 @@ If you want to run scripts that can be triggered one time, setup to trigger on G ## Quickstart - plumber API 1. Make an R API via [plumber](https://www.rplumber.io/) that contains entry file api.R. You can use the demo example in `system.file("example", package="cloudRunner")` if you like. -2. Deploy via the `cr_deploy_plumber()` function: +2. Create a Dockerfile for the API - see bottom of page for how to do this automatically with https://o2r.info/containerit/ + +The example folder has this Dockerfile: + +``` +FROM gcr.io/gcer-public/googlecloudrunner:master +COPY ["./", "./"] +ENTRYPOINT ["R", "-e", "pr <- plumber::plumb(commandArgs()[4]); pr$run(host='0.0.0.0', port=as.numeric(Sys.getenv('PORT')))"] +CMD ["api.R"] +``` + +3. Deploy via the `cr_deploy_plumber()` function: ```r library(googleCloudRunner) @@ -43,7 +54,7 @@ cr <- cr_deploy_plumber(my_plumber_folder) #url: https://cloudrunnertest2-ewjogewawq-ew.a.run.app ``` -3. Enjoy your API +4. Enjoy your API ### RStudio Gadget - deploy plumber script @@ -59,9 +70,8 @@ This sets up a Shiny UI to help smooth out deployments as pictured: Deployment via `cr_deploy_plumber()` automated these steps: -1. Creates a Dockerfile for your R script if necessary using [`containerit`](https://o2r.info/containerit/index.html) -2. Uploads the Dockerfile and your api.R file to your Google Cloud Storage bucket -3. Creates a Cloud Build job for building the files uploaded to the GCS bucket, and pushes the Docker images to Google Container Registry +1. Uploads the Dockerfile and your api.R file to your Google Cloud Storage bucket +2. Creates a Cloud Build job for building the files uploaded to the GCS bucket, and pushes the Docker images to Google Container Registry 3. Deploys that container to Cloud Run It will launch a browser showing the build on Cloud Build, or you can wait for progress in your local R sesion. Upon successfully deployment it gives you a `CloudRunService` object with details of the deployment. @@ -98,3 +108,46 @@ cr_run("gcr.io/my-project/my-image") * `cr_deploy_html()` adds steps to deploy a nginx web server ready to serve the HTML files you supply. +## Creating a Dockerfile with containerit + +`containerit` is not yet on CRAN so can't be packaged with the CRAN version of `googleCloudRunner` but its a useful package to work with since it auto-creates Dockerfiles from R files. + +To install it use `remotes::install_github("o2r-project/containerit")` + +[See `containerit`s website for more details](https://o2r.info/containerit/) on how to use it. + +An example of using it to help create plumber Dockerfiles is below: + +```r +library(containerit) +cr_dockerfile_plumber <- function(deploy_folder, ...){ + docker <- dockerfile( + deploy_folder, + image = "trestletech/plumber", + offline = FALSE, + cmd = Cmd("api.R"), + maintainer = NULL, + copy = list("./"), + container_workdir = NULL, + entrypoint = Entrypoint("R", + params = list( + "-e", + "pr <- plumber::plumb(commandArgs()[4]); pr$run(host='0.0.0.0', port=as.numeric(Sys.getenv('PORT')))") + ), + filter_baseimage_pkgs = FALSE, + ...)) + + write_to <- file.path(deploy_folder, "Dockerfile") + + write(docker, file = write_to) + + assert_that( + is.readable(write_to) + ) + + myMessage("Written Dockerfile to ", write_to, level = 3) + print(docker) + docker + +} +```