gpt4 book ai didi

windows - Capistrano 部署问题

转载 作者:太空宇宙 更新时间:2023-11-04 11:28:55 26 4
gpt4 key购买 nike

我正在尝试让 Capistrano 部署脚本正常工作,在我的部署文件中我有以下...

set :application, "example.com"
role :app, "root@12.34.56.789"
role :web, "root@12.34.56.789"
role :db, "root@12.34.56.789", :primary => true

set :user, "root"
set :deploy_to, "/example/www/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :keep_releases, 10

namespace :deploy do
desc "Tell Passenger to restart the app."
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end

desc "Symlink shared configs and folders on each release."
task :symlink_shared do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
run "ln -nfs #{shared_path}/assets #{release_path}/public/assets"
end

desc "Sync the public/assets directory."
task :assets do
system "rsync -vr --exclude='.DS_Store' public/assets #{user}@#{application}:#{shared_path}/"
end
end

after 'deploy:update_code', 'deploy:symlink_shared'

我在部署文件中还有一个 github 位置和 scm 变量。当我运行 cap deploy 时,它开始正常,要求输入 github 私有(private)存储库的用户名/密码,我输入了,没问题。然后在成功并正确提取代码之后我得到以下...

executing "if [ -d /example/www/example.com/shared/cached-copy ]; then cd /example/www/example.com/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 93e3432103327f29a9e66fa2755562bfe9bc4412 && git clean -q -d -x -f; else git clone -q https://github.com/example/example.git /example/www/social u.com/shared/cached-copy && cd /example/www/example.com/shared/cached-copy && git checkout -q -b deploy 93e3432103327f29a9e66fa2755562bfe9bc4412; fi" servers: ["12.34.56.789"] Password:

所以它要求输入密码。我猜这是为了ssh。我输入了 root 用户的密码,但是它无法显示这个...

    [12.34.56.789] executing command
** [12.34.56.789 :: err] Username:

我也尝试过完全不输入密码,但我得到以下信息......

Capistrano::ConnectionError, connection failed (Net::SSH::AuthenticationFailed: root)

要注意的是我输入了正确的 ssh 密码...我可以使用 putty 正常进行 ssh。顺便说一句,我在我的本地 Windows PC 上运行 cap deploy,而远程机器是一个 linux 机器。当然我的位置不是 12.34.56.78 但你明白了。关于如何解决的任何想法?

最佳答案

您需要为 GitHub 使用 SSH url,而不是 https。

关于windows - Capistrano 部署问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12612224/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com