0

几个月前,我曾经使用“cap deploy”命令从我的ubuntu PC 部署我的项目,没有问题。但是,我在几分钟前尝试从我的mac部署相同的项目,但 svn 命令失败(见下文)

executing locally: "svn info https://xxxx.jp/svn/xxx_iphone/trunk --username \"xxxx\"--password \"xxx\"--no-auth-cache  -rHEAD"

如您所见, [username],[password] 和 [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'

部署.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
4

2 回答 2

1

“不是版本控制的资源”在我看来就像您在目标文件夹中有一个不受版本控制的文件,而 Subversion 正在抱怨它。

我会尝试以下一项(或全部):

  • 在你的 Mac 和服务器上运行 'svn status' 来检查未版本化的文件
  • 在您的 Mac(可能还有服务器)上运行“svn cleanup”
  • 尝试使用 capistrano 控制台运行 capfile 中的步骤,并在运行“svn checkout”步骤之前进行一些探索(例如执行“svn status”)
  • 仔细检查目标文件夹 cap 是否正在尝试创建 (/u/apps/myproject/releases/20130826010624) 存在,如果存在则吹走。

如果这些都没有帮助,请发布您的 Capfile。

于 2013-08-28T07:39:36.833 回答
1

当我面对案件时,请在流程下检查。

  1. 检查“存储库的权限”。前任。“chmod ??? [存储库]”
  2. 检查“存储库的所有者”。
  3. 检查“存储库的权限”。它是“/etc/svnusers”。
  4. 检查服务器的状态;阿帕奇,Windows服务器。就是内存、cpu等等。
  5. 如果我们在 4 之后无法咨询问题。最后重新启动网络服务器

如果您无法解决 4 的状态,请发布详细信息。

于 2013-08-29T02:58:59.920 回答