幾個月前,我曾用我的Ubuntu PC與「cap部署」命令沒有問題部署我的項目。不過,我已經嘗試了幾分鐘前從我MAC部署相同的項目,但svn命令失敗(見下文)從SVN部署與capistrano應用程序從蘋果公司的macist
executing locally: "svn info https://xxxx.jp/svn/xxx_iphone/trunk --username \"xxxx\"--password \"xxx\"--no-auth-cache -rHEAD"
正如你所看到的,[用戶名],[密碼]和[NO- auth-cache]被粘住(沒有空間)。
Ubuntu下,我得到了這個命令(即正常執行)
executing locally: "svn info https://xxxx.jp/svn/xxx_iphone/trunk --username xxxx --password xxx --no-auth-cache -rHEAD"
的Ruby版本:2.0.0p0 Rails的版本:4.0.0
任何想法? 謝謝
==編輯
登錄信息:
$ bundle exe cap production deploy
triggering load callbacks
* 2013-08-26 10:06:14 10:06:14 == Currently executing `production'
production Do you really deploy? (yes/no)
yes
triggering start callbacks for `deploy'
* 2013-08-26 10:06:16 10:06:16 == Currently executing `multistage:ensure'
* 2013-08-26 10:06:16 10:06:16 == Currently executing `deploy'
* 2013-08-26 10:06:16 10:06:16 == Currently executing `deploy:update'
** transaction: start
* 2013-08-26 10:06:16 10:06:16 == Currently executing `deploy:update_code'
executing locally: "svn info https://xxxxxxx/svn/myproject/trunk --username \"xxxxx\"--password \"zzzzz\"--no-auth-cache -rHEAD"
Authentication realm: <https://xxxxx> Authorization
Password for 'xxxxx--password':
Authentication realm: <https://xxxxxx> Authorization
Username: xxxx
Password for 'xxxx':
zzzzzz--no-auth-cache: (Not a versioned resource)
svn: A problem occurred; see other errors for details
*** [deploy:update_code] rolling back
* executing "rm -rf /u/apps/myproject/releases/20130826010624; true"
servers: ["iphone.xxxxx.jp"]
Password:
[iphone.xxx.jp] executing command
command finished in 709ms
Command svn info https://xxxxx/svn/myproject/trunk --username "xxxx"--password "zzzz"--no-auth-cache -rHEAD returned status code pid 448 exit 1
我Capfile
load 'deploy'
load 'deploy/assets'
load 'config/deploy'
Deploy.rb
require "capistrano/ext/multistage"
require "capistrano_colors"
require "bundler/capistrano"
require "rvm/capistrano" # Load RVM"s capistrano plugin.
set :application, "mygirl"
set :copy_exclude, %w(.git .gitignore doc features log spec test tmp Capfile)
#set :shared_children, shared_children + %w(public/uploads)
set :use_sudo, false
set :user, "app"
set :stages, %w(staging production)
namespace :deploy do
task :start, roles: :app, except: { no_release: true } do
run "cd #{current_path} && bundle exec unicorn_rails -c config/unicorn.rb -E #{rails_env} -D"
end
task :stop, roles: :app, except: { no_release: true } do
run "kill -KILL -s QUIT `cat #{shared_path}/pids/unicorn.pid`"
end
task :restart, roles: :app, except: { no_release: true } do
stop
start
end
end
namespace :customs do
namespace :rake do
desc "Run a task on a remote server."
# run like: cap staging customs:rake:invoke task='db:version'
task :invoke, :roles => :db do
run("cd #{current_path}; BUNDLE_GEMFILE=#{current_path}/Gemfile bundle exec rake #{ENV['task']} RAILS_ENV=#{rails_env}")
end
end
end
def confirm
puts "\n\e[0;36m#{stage}\e[0m\e[0;31m Do you really deploy? (yes/no) \e[0m\n"
proceed = STDIN.gets rescue nil
exit unless proceed.chomp! == "yes"
end
你可以運行'bundle exe cap production deploy -vv',這樣我們就可以得到'非常詳細'的輸出。 – TomDunning
我用詳細模式得到了完全相同的消息。 – johann