Capistrano-sudo
Capistrano plugin for sudo operation with password input.
Requirements
- Capistrano ~> 3.3
Installation
Add this line to your application's Gemfile:
gem 'capistrano'
gem 'capistrano-sudo'
And then execute:
$ bundle install
Configuration
You can also Capistrano variables with set name, value
.
Name | Default | Description |
---|---|---|
password | ENV['SUDO_PASSWORD'] | target machine's sudo password |
Usage
Add this line to your application's Capfile:
require 'capistrano/sudo'
And use the sudo!
DSL in your task:
task :something do
on roles(:all) do |host|
sudo! :mkdir, '/foo/bar'
end
end
And execute cap
command with sudo password, like this:
% SUDO_PASSWORD=<sudopass> bundle exec cap production deploy
Contributing
- Fork it ( https://github.com/[my-github-username]/capistrano-sudo/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request