View source: R/buildstep_templates_git.R
cr_buildstep_gitsetup | R Documentation |
This creates steps to configure git to use an ssh created key.
This creates steps to use git with an ssh created key.
cr_buildstep_gitsetup(secret, post_setup = NULL)
cr_buildstep_git(
git_args = c("clone", "git@github.com:[GIT-USERNAME]/[REPOSITORY]", "."),
...
)
git_volume()
secret |
The name of the secret on Google Secret Manager for the git ssh private key |
post_setup |
Steps that occur after git setup |
git_args |
The arguments to send to git |
... |
Further arguments passed in to cr_buildstep |
The ssh private key should be uploaded to Google Secret Manager first
cr_buildstep
must come after cr_buildstep_gitsetup
Use git_volume
to add the git credentials folder to other buildsteps
Accessing private GitHub repositories using Cloud Build (google article)
Other Cloud Buildsteps:
cr_buildstep_bash()
,
cr_buildstep_decrypt()
,
cr_buildstep_df()
,
cr_buildstep_docker()
,
cr_buildstep_edit()
,
cr_buildstep_extract()
,
cr_buildstep_gcloud()
,
cr_buildstep_mailgun()
,
cr_buildstep_nginx_setup()
,
cr_buildstep_packagetests()
,
cr_buildstep_pkgdown()
,
cr_buildstep_run()
,
cr_buildstep_r()
,
cr_buildstep_secret()
,
cr_buildstep_slack()
,
cr_buildstep_targets()
,
cr_buildstep()
cr_project_set("my-project")
cr_bucket_set("my-bucket")
# assumes you have previously saved git ssh key called "github-ssh"
cr_build_yaml(
steps = c(
cr_buildstep_gitsetup("github-ssh"),
cr_buildstep_git(c(
"clone",
"git@github.com:github_name/repo_name"
))
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.