Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am sirgraystar on github.
  • I am odavies (https://keybase.io/odavies) on keybase.
  • I have a public key whose fingerprint is 1DE4 CEC4 5462 F898 F85C 3722 166B B5AF 74D2 680C

To claim this, I am signing this object:

@owendavies93
owendavies93 / windows_rails_deployment.md
Created January 29, 2014 15:20
Windows Rails Deployment when SSH keys won't play nicely

Sometimes Windows (via git bash or whatever) won't play ball with OpenSSH, much to my annoyance. This means that most Rails deployment options won't work, because they stupidly rely on SSH keys with no password fall back. However, there is a (slightly hacky) solution thanks to PuTTY, or more specifically plink, which is headless PuTTY.

After setting up keys for an ssh session with PuTTY (which always works with Windows, unlike other solutions), you can run this:

git push production master &&
plink atlee "cd /path/to/app && rake db:migrate && rake assets:precompile && touch tmp/restart.txt

My PuTTY session for the remote server is saved as 'atlee'. Obviously you could make a sick Rakefile and then just run that instead of the individual rake commands. The last command restarts Passenger.