RepoSource Object

RepoSource(
  repoName = NULL,
  tagName = NULL,
  commitSha = NULL,
  branchName = NULL,
  dir = NULL,
  projectId = NULL
)

Arguments

repoName

Name of the Cloud Source Repository

tagName

Regex matching tags to build

commitSha

Explicit commit SHA to build

branchName

Regex matching branches to build e.g. ".*"

dir

Directory, relative to the source root, in which to run the build

projectId

ID of the project that owns the Cloud Source Repository

Value

RepoSource object

Details

Location of the source in a Google Cloud Source Repository.

Only one of commitSha, branchName or tagName are allowed.

If you want to use GitHub or BitBucket repos, you need to setup mirroring them via Cloud Source Repositories https://source.cloud.google.com/

Examples

cr_project_set("my-project")
#>  2022-03-26 19:55:41 > ProjectId set to my-project
#> [1] "my-project"
cr_bucket_set("my-bucket")
#>  2022-03-26 19:55:41 > Bucket set to my-bucket
#> [1] "my-bucket"
if (FALSE) {

my_repo <- cr_build_source(
  RepoSource("github_markedmondson1234_googlecloudrunner",
    branchName = "master"
  )
)

build <- cr_build(
  cr_build_yaml(
    steps =
      cr_buildstep("gcloud", c("-c", "ls -la"),
        entrypoint = "bash",
        dir = ""
      )
  ),
  source = my_repo
)
}