okbreathe/capistrano-nginx-foreman — pull request #1 by tinynumbers (2013-08-30 14:23:26+00:00)
Title: A number of fixes/tweaks/updates

I've made a few changes in my fork of this project which you may want to merge back in. If you want me to separate them out into multiple independent pull requests then let me know and I'll try to do that.

Summary:

* commit 1c8b960
* updated the foreman:export step which checks for presence of foreman_upstart_path to use generic sh syntax to check for directory existence (instead of bash-specific syntax)
* modified foreman:start/stop/restart steps to use upstart commands (e.g. "start X" instead of "service X start")
* added an optional file-mode parameter to the template method, defaulting to 0600, to specify the file permissions of the processed template when it is uploaded to the server
* commit 4eec0f9
* added the ability to gracefully handle a blank/nil nginx_server_name for the cases when you need to deploy to a server that doesn't have a DNS name / only has an IP address
* commit b7ce5b8
* removed ConfigGenerator reference to non-existent unicorn_init.rb template
* commit 18fd9be
* modified foreman:export to first export to a temporary directory, then move the exported files to the foreman_upstart_path

The last of these is specifically to work around a problem that would be encountered if deploying to a server that uses rbenv to manage Ruby versions. Running sudo within rbenv is problematic and breaks when run from a Capistrano task. See https://github.com/dcarley/rbenv-sudo/pull/2#issuecomment-23501080 for details.