スマート ミラーリング
ソース コード リポジトリへのリンク
このページの内容
関連コンテンツ
- Regenerate SSH keys for Bitbucket Data Center
- Bitbucket Data Center
- Linking Bitbucket Cloud repositories with Bamboo
- Bamboo does not automatically create plan branches from a cloned Bitbucket Server or Data Center instance
- Bamboo does not automatically create plan branches from a cloned Bitbucket Data Center instance
- Triggering a build from Bitbucket Cloud using the Remote trigger (legacy)
- Bamboo reports HTTP 400 Bad Request with "mirrors.not.supported", "repository.stash.error.mirror.versionNotSupported" responses when interacting with Bitbucket Server
- Bamboo 9.1+ build status not updated in Bitbucket version older than 7.4 with warning Request to Bitbucket Server failed. Returned with 404
- Bitbucket Cloud
- Integrating Bamboo with Bitbucket Data Center
Bamboo provides support for Smart Mirroring in Bitbucket Data Center. Smart Mirroring allows you to use local repositories for storing your repository data to avoid having to wait when cloning a repository from a remote location.
For more on Smart Mirroring, see Mirrors.
Prerequisites
- Bitbucket Data Center 7.5 以降
- routing from Bamboo to your Bitbucket Data Center instance
- routing between agent and mirror
To enable Smart Mirroring in Bamboo:
- From the Bamboo header select > Build resources > Linked repositories.
- Select your Bitbucket Data Center repository.
- In the Edit repository section, select Advanced options.
- From the Mirror drop-down list, select your mirror location.
Bulk update of Smart Mirroring settings for repositories
Starting from Bamboo 6.10.3, you can update the mirrors for all repositories of a single Bitbucket Data Center.
You can update the Mirror field value by using the following REST endpoint:
POST /rest/stash/latest/bulk/APPLICATION_LINK_ID/mirror
APPLICATION_LINK_ID
: the ID of a linked Bitbucket Data Center instance. Read below for more info on how to find it.
Payload format
Perform a dry run (without an actual update), and reset all repositories to the master node. This will allow you to disable the usage of mirrors for all Bitbucket Data Center repositories in Bamboo.
{ resetToPrimary:true, dryRun:true }
Here's a sample output:
{ "size": 21, "limit": 21, "lastPage": true, "start": 0, "values": [ { "id": 1770061851, "name": "Bamboo Version Stable", "global": false, "selfUrl": "http://BAMBOO_URL/chain/admin/config/editChainRepository.action?buildKey=ZJM-VCT", "oldMirrorId": "", "oldMirrorName": "", "newMirrorId": "primary", "newMirrorName": "Primary" }, { "id": 2357198853, "name": "bamboo-stash-plugin", "global": true, "selfUrl": "http://BAMBOO_URL/admin/editLinkedRepository.action?repositoryId=2357198853", "newMirrorId": "primary", "newMirrorName": "Primary" }, { "id": 1642397765, "name": "bamboo-doc-code", "global": true, "selfUrl": "http://BAMBOO_URL/admin/editLinkedRepository.action?repositoryId=1642397765", "newMirrorId": "primary", "newMirrorName": "Primary" }, { "id": 1775861823, "name": "bamboo-some-code", "global": true, "selfUrl": "http://BAMBOO_URL/admin/editLinkedRepository.action?repositoryId=1775861823", "oldMirrorId": "", "oldMirrorName": "", "newMirrorId": "primary", "newMirrorName": "Primary" }, { "id": 2439381015, "name": "static assets", "global": false, "selfUrl": "http://BAMBOO_URL/chain/admin/config/editChainRepository.action?buildKey=TEST-CIWEBDRIVERCDN", "newMirrorId": "primary", "newMirrorName": "Primary" }, { "id": 1738702849, "name": "atlassian-plugin", "global": true, "selfUrl": "http://BAMBOO_URL/admin/editLinkedRepository.action?repositoryId=1738702849", "oldMirrorId": "BFHH-O74T-KDGH-CT47", "oldMirrorName": "US East Mirror", "newMirrorId": "primary", "newMirrorName": "Primary" } ]
Update all Bitbucket Data Center repositories, so they start using the provided mirror.
{ mirrorId:"MIRROR_ID", ignoreErrors: true }
This will tell all repositories linked to a given Bitbucket Data Center Application Link to use the provided mirror. The
ignoreErrors
flag allows to skip updating repositories that aren't supported by the given mirror. The response will contain all affected repositories.
Obtaining the Bitbucket Data Center application link value
Use the following snippet to print the list of all Bitbucket Data Center instances known to Bamboo, together with their Application Link IDs:
curl -H "Content-Type: application/json" -H "Accept: application/json" http://BAMBOO_URL/rest/stash/latest/servers
Obtaining the Mirror ID value:
Use the following snippet to print the mirror servers that are configured in Bitbucket Data Center, together with their IDs:
curl -H "Accept: application/json" https://BITBUCKET_SERVER_URL/rest/mirroring/latest/mirrorServers
Downgrading from Bitbucket Data Center license to a regular license may cause problems. In the unlikely event of such a downgrade, we recommend switching all repositories to primary before switching versions.
関連コンテンツ
- Regenerate SSH keys for Bitbucket Data Center
- Bitbucket Data Center
- Linking Bitbucket Cloud repositories with Bamboo
- Bamboo does not automatically create plan branches from a cloned Bitbucket Server or Data Center instance
- Bamboo does not automatically create plan branches from a cloned Bitbucket Data Center instance
- Triggering a build from Bitbucket Cloud using the Remote trigger (legacy)
- Bamboo reports HTTP 400 Bad Request with "mirrors.not.supported", "repository.stash.error.mirror.versionNotSupported" responses when interacting with Bitbucket Server
- Bamboo 9.1+ build status not updated in Bitbucket version older than 7.4 with warning Request to Bitbucket Server failed. Returned with 404
- Bitbucket Cloud
- Integrating Bamboo with Bitbucket Data Center