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タグからアプリをデプロイできることです。しかし明らかに私は展開するたびに新しいタグを作成したくありません。
変更が 'master'ブランチにあることを確認してください。フィーチャーブランチをマスターにマージするのを忘れてしまったので、私はあなたの正確な問題を抱えていました。 – nathan
ありがとうございます。私は 'マスター 'にいるので、なぜそれが古いコミットをつかんでいるのか、本当に困惑しています。私は '/ var/git/snip.git'から新しいクローンを作成することで、すべてがプッシュされることを二重チェックしました。確かに、 'snip.git'は最新のものです。 –
完全に異なる注記:なぜタグを展開するのに興味がありませんか?より慎重に思えますし、コードをより簡単にロールバックするのに役立ちます。 – Ekampp