cap deploy
プロセスの終わりに向かって特定の時点で実行すると、パスワードプロンプトが表示されます...
** keeping 5 of 6 deployed releases
* executing "sudo -p 'sudo password: ' rm -rf /opt/deployed_rails_apps/myapp/releases/20120922200242"
servers: ["myhost.com"]
[username@myhost.com] executing command
Password:
パスワードの入力を求めずに完了する方法はありますか?
これが私のdeploy.rb
...
require "bundler/capistrano"
require "rvm/capistrano"
set :rvm_ruby_string, 'ruby-1.9.3-p194@run_passenger'
set :rvm_type, :user
set :application, 'myapp'
set :repository, 'git@github.com:fakename/myrepository.git'
set :deploy_to, "/opt/deployed_rails_apps/#{application}"
set :scm, "git"
set :branch, "master"
set :deploy_via, :remote_cache
set :keep_releases, 5
after "deploy:update", "deploy:cleanup"
load 'deploy/assets'
role :app, 'username@myhost.com'
role :web, 'username@myhost.com'
namespace :deploy do
task :start, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
task :stop, :roles => :app do
# Do nothing.
end
desc "Restart Application"
task :restart, :roles => :app do
run "touch #{current_release}/tmp/restart.txt"
end
end