Skip to content

deployment prerequisites

Harmen Janssen edited this page Aug 22, 2016 · 1 revision

Ruby < 3

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.

Installing the Capistrano client

On OSX, install as follows:

$ sudo gem install capistrano
$ sudo gem install capistrano-ext

Private / public key for Git authentication

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:

  1. Click your avatar, top right
  2. Click Manage account
  3. Find SSH keys in the menu on the left

Setting up the SSH agent

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.

Setting up key forwarding

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
Clone this wiki locally