Custom Git Data Source Credential
Bitbucket / Custom Git
[Administrator]
For special git repositories, such as Bitbucket, use Custom Git. It provides flexibility for special Git systems.
Bitbucket PAT Creation Notes
Bitbucket allows PATs to be created at the Project or the Repository level. In this description the PAT was created at the repository level
- Within the Bitbucket repository, go to Repository Settings -> Access Tokens select Create Repository Access Token
- Give the token a name that can be easily identified
- Select the scopes of Read/Write/Delete
- Press Create
There should be a new screen that appears showing the newly created PAT and the various ways to leverage it. Be sure to save the contents of this screen as everything but the email user.email section will no longer be visible once closed.
The sections that are of most importance have been marked in red. These will be referenced later when filling out the configuration in Command Center. They are, from top to bottom:
- Repository access token
- How to use this token with your Git Repository
- The git config user.email
Now that the PAT has been created, it can be incorporated into Command Center as follows.
Create a new Data Source Credential
- Open the Settings section (Gear Icon) from the Dashboard page
- Select "Maintenance Mode" (Must be an Administrator to do this) to unlock the Data Source Credentials area
- Select the Data Source Credentials
- Selecti the (Create new credential) button on the Manage Data Source Credentials page.
Select the Custom Git card
The Custom Git Connection Form will open
Enter the details for the Custom Git Form
- Enter a Username.
- The username will be x-token-auth as provided by Bitbucket as part of the git clone URL when the PAT was initially created. This can be found in the "How to use this token with your Git Repository" when the PAT was created marked in red in the screenshot prior.
- Its from here: git clone https://x-token-auth:<PAT>@bitbucket.org/<ACCOUNT>/<REPO>.git
- Enter the Personal access token
- The PAT is the Token itself as provided by Bitbucket in the top text box marked in red in the screenshot prior marked as "Repository Access Token". This is the PAT itself.
- Enter the Commit author - You can put whatever you wish here
- Enter the Commit email
- If the Bitbucket provided user.email is input here, when commits occur from Command Center, within Bitbucket commits from Command Center will show as the token name provided when the PAT was created in Bitbucket. This is the "git config user.email" token marked in red in the screenshot prior.
- Enter the Git server URL, for example, https://bitbucket.org/account/
- Next
Give the new credential a name
- The name should be something that is easily identified when applied from a project as the being the correct PAT
- Assign it to applicable managers
- Create
The system should return to the Manage Data Source Credentials page with "Credential created" note and the new credential should be listed.
At this point, this credential can be added to a project in the same manner as any other source credential.