Migrate Bitbucket repositories to Github
- Install nvm
brew install nvm
-
Configure Node Version Manager (nvm) as described here
-
Configure SSH key in GitHub by clonning dev-envs and running config-github.sh script
source ./init.sh
- Download GitHub app for mobile
- Create Github Personal Access Token (PAT) with the scopes specified
- Create Bitbucket Access Token
- Update the following in .env-template file:
- GitHub username
- GitHub and BitBucket tokens
- Repository to migrate
- Run migration script
$ node migration.js --help
Usage: migration.js --ght [string] --bbt [string] --repo [string] --owner [string]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--ght Github Personal Access Token (PAT) [require]
--bbt BitBucket Personal Access Token (PAT) [required]
--repo Repository to migrate [required]
--owner Github username [required]
- For example:
node migration.js --bbt BB_TOKEN --ght GH_TOKEN --owner USER --repo REPO_NAME
- Update Cloudbuild with the new github repository
- connect repository
- replace
cloudBuild.yml
trigger
- Verify CI/CD for your module works
- Delete your repository from bitbucket once it becomes obsolete
- Run validation by leveraging pre-commit as described here
- Install
pre-commit install --install-hooks -t pre-commit -t commit-msg
- To run on-demand
pre-commit run -a
- Install
- Submit a pull-request