politicalrev / political-revolution.com

The website for Political Revolution
https://political-revolution.com
11 stars 7 forks source link

`cap staging deploy` through Travis fails on pull requests authored by unauthorized users #31

Closed Smona closed 7 years ago

Smona commented 7 years ago

This prevents us from being able to check the effect of PRs on the staging site before merging them. When attempting to push PR builds, the following error occurs:

$ bundle exec cap staging deploy
INFO[51110713] Running /usr/bin/env mkdir -p /tmp/wpdev.thepoliticalrev.org/ on 45.55.137.23
DEBUG[51110713] Command: ( WP_ENV=staging /usr/bin/env mkdir -p /tmp/wpdev.thepoliticalrev.org/ )
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 45.55.137.23: Authentication failed for user deploy@45.55.137.23
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/net-ssh-2.9.1/lib/net/ssh.rb:219:in `start'

I suspect this may be an issue with Capistrano forwarding GitHub user ssh keys instead of using its own deploy key.

Smona commented 7 years ago

We are no longer running builds on PRs, only on pushes, where this permissions error does not occur.