integrity/integrity — pull request #175 by JangoSteve (2012-07-27 02:14:58+00:00)
Title: Added ability to git checkout via ssh identity key

The docs state that it isn't possible to setup Integrity to use an SSH deploy key on Heroku. I didn't consider any of the workarounds to be acceptable for our situation, so I figured out a way to make this work. Taking a note from [this stackoverflow post](http://stackoverflow.com/a/3500308/366381), I created a bash wrapper for the git commands, so that they could use a private SSH deploy key.

With this pull request, you simply need to generate a new ssh key pair ([see github instructions](https://help.github.com/articles/generating-ssh-keys), but make sure not to do this in your local .ssh directory, as nether of these keys are for your local machine).

Then, add the public ssh key to your github repo's deploy keys (at github.com/myrepo/admin/keys). And add the contents of the private key to a heroku config var.

```
heroku config:add DEPLOY_PRIVATE_KEY="----contents of private key
second line of private key
make sure to use double quotes
to allow multi-line config var value
end of private key-----------"
```

Now, when Integrity detects the `ENV['DEPLOY_PRIVATE_KEY']` variable, it will use the git_ssh wrapper for the git commands.