This helps the common use case of building a Dockerfile based on the contents of a GitHub repo, and sets up a build trigger so it will build on every commit.

cr_deploy_docker_trigger(
  repo,
  image,
  trigger_name = paste0("docker-", image),
  image_tag = c("latest", "$SHORT_SHA", "$BRANCH_NAME"),
  ...,
  substitutions = NULL,
  ignoredFiles = NULL,
  includedFiles = NULL,
  timeout = NULL,
  projectId = cr_project_get()
)

Arguments

repo

The git repo holding the Dockerfile from cr_buildtrigger_repo

image

The name of the image you want to build

trigger_name

The trigger name

image_tag

What to tag the build docker image

...

Arguments passed on to cr_buildstep_docker

tag

The tag or tags to be attached to the pushed image - can use Build macros

location

Where the Dockerfile to build is in relation to dir

dockerfile

Specify the name of the Dockerfile found at location

kaniko_cache

If TRUE will use kaniko cache for Docker builds.

substitutions

A named list of Build macro variables

ignoredFiles

ignored_files and included_files are file glob matches extended with support for "**".

includedFiles

If any of the files altered in the commit pass the ignored_files

timeout

Amount of time that this build should be allowed to run, to second

projectId

The project to build under

Details

This creates a buildtrigger to do a kamiko cache enabled Docker build upon each commit, as defined by your repo settings via cr_buildtrigger_repo. It will build all tags concurrently.

See also

cr_deploy_docker which lets you build Dockerfiles for more generic use cases

Other Deployment functions: cr_deploy_docker(), cr_deploy_packagetests(), cr_deploy_pkgdown(), cr_deploy_run_website(), cr_deploy_run(), cr_deploy_r()

Examples

if (FALSE) { repo <- cr_buildtrigger_repo("MarkEdmondson1234/googleCloudRunner") cr_deploy_docker_trigger(repo, "test", dir = "cloud_build") }