Reputation: 11
Define the directory where source code is stored in the source repository
Hi, I am creating a cloud function 2nd generation and I am using code from another source repository. I am using Terraform and the module "google_cloudfunctions2_function". Currently I am using Cloud Source Repository as my "repo_source". But I would like to use a BitBucket repository. I can not mirror Cloud Source Repository and BitBucket (as described here: https://cloud.google.com/source-repositories/docs/mirroring-a-bitbucket-repository?hl=de) because BitBucket is hosted from an internal organisation.
repo_source = {
project_id = var.project_id
repo_name = "MY_REPO"
branch_name = "master"
}
Is there any possibility to use BitBucket source repo in "repo_source" or with any other key word?
I can not mirror Cloud Source Repository and BitBucket (as described here: https://cloud.google.com/source-repositories/docs/mirroring-a-bitbucket-repository?hl=de) because BitBucket is hosted from an internal organisation.
Upvotes: 0
Views: 808
Reputation: 1
Capabilities: You can connect repositories from Bitbucket Data Center and Bitbucket Server
Cloud Build repositories (1st gen) - YES
Cloud Build repositories (2nd gen) - NO
Ref: https://cloud.google.com/build/docs/repositories#repositories_1st_gen_and_repositories_2nd_gen
Upvotes: 0
Reputation: 3575
I see two potential solutions. Both involve pushing the code in some way
You can either sync the BitBucket repository yourself. E.g. create a BitBucket pipeline, that pushes your code to the Cloud Source Repo.
Or alternatively you use the storage_source
block from cloudfunctions2_function.
That requires that your code is uploaded as a zip file to a Cloud Storage Bucket. So you again need a BitBucket Pipeline, that zips and uploads your code.
Upvotes: 1