delta-capistrano
Extends the capistrano DSL allowing one to run commands as a specified user as if in a shell. Just require delta-capistrano in your deploy and you are good to go.
single command:
in_a_shell_as("u", "from argument")
# would be equivalent of
sudo "sh -c 'from argument'", :as => "u"
multiple commands in a block:
in_a_shell_as("u") do |shell|
shell.run "from block once"
shell.run "from block twice"
end
# would be equivalent of
sudo "sh -c 'from block once; from block twice'", :as => "u"
Note on Patches/Pull Requests
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright
Copyright © 2010 Robin Spainhour. See LICENSE for details.