Capistrano部署了我的应用程序的错误版本

时间:2012-02-29 19:59:18

标签: ruby-on-rails-3 git capistrano

我正在将一个带有Capistrano的Rails 3.2.1应用程序部署到Ubuntu / Passenger / Apache服务器。当我运行cap deploy时,它运行正常,但是当我在浏览器中访问我的应用程序时,我可以看到它是我几个月前使用的版本,而不是我当前版本的应用程序。

这是我的config/deploy.rb

require "bundler/capistrano"

set :user, "jason"
set :domain, "sniphq.com"
set :application, "Snip"
set :repository,  "/var/git/snip.git"

set :scm, "git"
set :branch, "master"
set :git_shallow_clone, true
set :scm_verbose, true

role :web, domain                          # Your HTTP server, Apache/etc
role :app, domain                          # This may be the same as your `Web` server
role :db,  domain, :primary => true # This is where Rails migrations will run

set :deploy_to, "/home/jason/snip-cap"
set :deploy_via, :export

default_run_options[:pty] = true

# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts

# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end
end

为什么会发生这种情况?

编辑:有趣且可能有用的是,我可以按照here的说明从特定的Git标记部署我的应用。但显然我不希望每次部署时都创建一个新标签。

1 个答案:

答案 0 :(得分:0)

原来我把它指向了错误的回购。