- Generate SSH key in BitBucket.
- Add the SSH key to the FortRabbit server via terminal.
ssh your-account@deploy.us1.frbit.co
cd ~/.ssh
vi authorized_keys
- Paste the BitBucket SSH key.
- Press escape, then type
:
and wq
to write and quit.
- In BitBucket, add the
deploy.us1.frbit.com
FortRabbit url found in SFTP tab as a known host. The fingerprint should be generated automatically. - Create a
bitbucket-pipelines.yml
file in your project root. The code below is a good starting template.
image: php:7.0.0
pipelines:
branches:
your-project-name:
- step:
deployment: staging
script:
- apt-get update && apt-get install -y unzip git ssh
- git remote add fortrabbit your-project-name@deploy.us1.frbit.com:your-project-name.git
- git push fortrabbit your-project-name -f
- Note that your-project name should also match one of your branch names. This branch will be used to deploy. Other branches will still push to BitBucket but won’t be uploaded onto FortRabbit.