'Mirror Bitbucket Repositories to Google Cloud Source Repositories
I am trying to build CICD using cloud build in GCP. As a part of that, I am trying to mirror the repositories from Bitbucket into CSR. But I am not able to mirror the repositories. I am able to view the repositories that are present in the Bitbucket after authorizing to bitbucket from GCP.
https://cloud.google.com/build/docs/automating-builds/create-manage-triggers https://cloud.google.com/source-repositories/docs/mirroring-a-bitbucket-repository
IAM Permissions:
I have Admin access for Source Repositories in GCP along with Cloud Build Service Account. I have Admin access for the bitbucket repository and the workspace. The workspace in bitbucket is private.
Solution 1:[1]
Per the Cloud Source Repositories
If you are mirroring your Bitbucket repository to Cloud Source Repositories to integrate with Cloud Build and do not need any other Cloud Source Repositories features, follow the Cloud Build instructions on building repositories from Bitbucket Cloud instead.
The referenced guide, Building repositories from Bitbucket Cloud, mentions that you need to create an SSH key in order to authenticate your connection to Bitbucket Cloud.
Bitbucket documenentation also confirms that the connection fails if there is no SSH key.
Solution 2:[2]
I have learned that the repositories in the Bitbucket are in Private Workspace and are IP restricted. So adding a set of Google Cloud's Public IPs solved this issue.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Farid Shumbar |
Solution 2 | Aditya Ch |