-
Notifications
You must be signed in to change notification settings - Fork 5
deployment prerequisites
You need a Ruby version lower than 3 (like 1.9.x) to deploy Garp 3 projects with Capistrano. Later Ruby versions will not work. RVM is highly recommended.
On OSX, install as follows:
$ sudo gem install capistrano
$ sudo gem install capistrano-ext
Bitbucket needs to know who you are. If you don't have a separate key for Bitbucket yet, generate one now:
$ ssh-keygen
By default, this will generate ~/.ssh/id_dsa and ~/.ssh/id_dsa.pub. Load the .pub file into your Bitbucket administration page:
- Click your avatar, top right
- Click Manage account
- Find SSH keys in the menu on the left
When you deploy, you're forcing a Git checkout from the server. This server does not hold your SSH key and therefore cannot authenticate with Bitbucket. Because it's way past 1990, we don't want to type in passwords - so we need ssh-agent. This will forward your key to the remote server. To the repository, it's as if the private key is located on the server.
To enable password-less deployment, we need to load the proper SSH private key file into ssh-agent. Save yourself from typing passwords and add the following line to ~/.bash_profile:
ssh-add ~/.ssh/id_rsa > /dev/null 2>&1
Where id_rsa is the name of the private key file you use to connect to the Grrr repository with.
Make sure the servers you want to deploy to are mentioned in ~/.ssh/config on your local machine. The following example forwards the private keys in memory (put there by ssh-agent) to staging.example.com and *.puffy-dragons.com.
Host staging.example.com
ForwardAgent yes
Host *.puffy-dragons.com
ForwardAgent yes