Bitbucket
To integrate your Bitbucket repositories with Komment, you will need to mirror them on GitHub.
Steps
- First, go to GitHub and create a destination repository.
- Your destination repository can be empty, but be sure to give it a name and set its visibility (public or private) according to your needs. Once you've filled in the details, click Create repository to proceed.
- Navigate to the Bitbucket repository you want to import into Komment. Using the left-hand side menu, go to Repository settings > Pipelines > Settings.
- Next, navigate to Repository settings > Pipelines > SSH keys.
- Click on Generate keys.
- Copy the public key.
- Back in your destination repository on GitHub, head to the Settings menu.
- Navigate from Settings > Security > Deploy keys.
- Click on Add deploy key.
- Paste the public key into the Key box. You will also need to tick the checkbox to Allow write access. Once done, click on Add key.
- Back on Bitbucket, head to Repository settings > Security > Access keys in the repository you want to mirror.
- Click on Add key.
- Give your new key a name, and paste in the public key you copied in Step 5. Once done, click on Add SSH key.
- Create a
bitbucket-pipelines.yml
file in your BitBucket repository or add this to your existing file:
pipelines:
default:
- step:
name: Sync GitHub Mirror
image: alpine/git:latest
clone:
enabled: false
script:
- git clone --bare git@bitbucket.org:RepoOrg/RepoName.git
- cd RepoName.git
- git push --mirror git@github.com:RepoOrg/RepoName.git
Once this is pushed, any further pushes to BibBucket will be automatically synced to the GitHub destination repository.
Do note you need to substitute 'RepoName' and 'RepoOrg' with the names of your own repositories. In our worked example, this is the resulting yaml file:
- You can check if your pipeline ran successfully by navigating to the Pipelines section of your Bitbucket repository. A successful pipeline status will indicate content has been pushed to GitHub.
You can now import the project as normal on Komment.