ser*_*erg 10 deployment passwords ssh capistrano ruby-on-rails
我正在尝试使用Capistrano 3来部署Rails 4应用程序.
#config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'testapp'
set :scm, :git
set :repo_url, 'git@bitbucket.org:sergiotapia/testapp.git'
set :user, "deploy" # The user on the VPS server.
set :password, "hunter2$$"
set :use_sudo, false
set :deploy_to, "/home/deploy/www/testapp"
set :deploy_via, :remote_cache
set :pty, true
set :format, :pretty
set :keep_releases, 1
set :rails_env, "production"
set :migrate_target, :latest
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :touch, release_path.join('tmp/restart.txt')
execute :touch, release_path.join('tmp/restart.txt')
system "curl --silent #{fetch(:ping_url)}"
end
end
after :publishing, :restart
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
Run Code Online (Sandbox Code Playgroud)
运行时,cap production deploy我收到以下消息:
DEBUG [322bb1fd] Enter passphrase for key '/home/deploy/.ssh/id_rsa':
Run Code Online (Sandbox Code Playgroud)
当我输入终端时,我可以看到这些字符,通常你只是在输入密码时看到空格,对吧?
DEBUG [484154d4] Enter passphrase for key '/home/deploy/.ssh/id_rsa':
qwef
ewf
qw
ef
qwef
wqe
f
qwef
wqe
f
^Ccap aborted!
Interrupt:
Run Code Online (Sandbox Code Playgroud)
我输入密码然后按回车键,它就会停留在那里而没有任何新的发展.我必须按Ctrl + C才能真正离开终端.
我可以在deploy.rb文件中设置SSH密码吗?
我有同样的问题。
我所做的就是更改我的配置。为了避免 capistrano 要求您输入密码,您必须设置`
set :pty, false
Run Code Online (Sandbox Code Playgroud)
然后,您必须在用于触发终端的任何计算机上生成部署密钥(您可以在这里找到一个非常好的指南https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git特别是如果您使用的是 bitbucket)并运行cap production deploy
问题是,默认情况下,capistrano 会将forward_agent 设置为true ,这将使用计算机中生成的密钥在远程代码存储库中进行身份验证。
| 归档时间: |
|
| 查看次数: |
3281 次 |
| 最近记录: |