2012-02-29 101 views
1

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

这里是我的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标签部署我的应用程序。但显然,我不想每次部署时创建一个新标签。

+0

确保您的更改在'master'分支上。我遇到了确切的问题,因为我忘了将功能分支合并回主。 – nathan 2012-02-29 20:16:36

+0

谢谢。我在'master'上,所以我对为什么要抓取一个旧的提交感到困惑。我甚至仔细检查过,通过'/ var/git/snip.git'创建一个新的克隆来推动一切。果然,'snip.git'是最新的。 – 2012-02-29 20:20:17

+0

完全不同的说明:您为什么不对部署标签感兴趣?这看起来更加谨慎,并且可以帮助您更轻松地回滚代码。 – Ekampp 2012-02-29 21:37:19

回答

0

原来我指出了错误的回购。

相关问题