-
Suggestion
-
Resolution: Low Engagement
-
None
-
0
-
4
-
When creating Plan Repository or Linked Repository, it would be better to have an option to store the SSH key into Bitbucket Server Repository Access Key or User Account.
In the latest Bamboo version, the SSH key is stored in Bitbucket Server Repository Access Key if the user have the permission to edit the Repository setting. If the user does not have the permission, then the SSH key will be stored in the User account.
Due to Bitbucket Server Branch Permission, the SSH key stored in Bitbucket Server Repository Access Key does not work with Bamboo Branch Updater or Gatekeeper.
It would be great if there is an option to select storing SSH key in User account when creating Repository in Bamboo.
Workaround
- Create a user in Bitbucket Server without the Admin permission to the Repository
- Create a user with the same username in Bamboo with Admin Permission
- Configure this user to have Branch Permission in Bitbucket Server
- Login with the new user in Bamboo to delete and recreate the Repository
If it is a Linked Repository, will need to re-add the repository into Plan Configuration - Stop Bamboo
- Backup Bamboo database for rollback purposes
- Run the following SQL in Bamboo database
SELECT * FROM vcs_location WHERE NAME='<display-name-in-step-4>' ORDER BY VCS_LOCATION_ID DESC LIMIT 1;
The SSH key stored in column XML_DEFINITION_DATA looks like the following example:
<key> <private>xxx...</private> <public>ssh-rsa yyy... http://localhost:8085</public> <isRepositoryStoredKey>false</isRepositoryStoredKey> </key>
This is the SSH key generated by Bamboo to be stored in Bitbucket Server User account in step 4
The SSH key used by Branch Plan might still be the old SSH key - Run the following SQL query to search for old repository setting
SELECT * FROM vcs_location WHERE NAME='<old-display-name>';
- Update all the result to have the same SSH key
- Restart Bamboo