2016-06-01 6 views
0

Capistranoを使用してプロダクションサーバーにRailsアプリケーションをデプロイしようとすると、GitHubから直接プロジェクトをクローンしたにもかかわらず、自分のプロジェクトをgit repoとして認識していないようです。CapistranoとGit Deploy Rails App

GITのLOG:

$ git status 
On branch master 
Your branch is up-to-date with 'origin/master'. 
nothing to commit, working directory clean 

CAPのLOG:

$ cap production deploy 

    triggering load callbacks 
    * 2016-06-01 16:30:26 executing `production' 
    triggering start callbacks for `deploy' 
    * 2016-06-01 16:30:26 executing `multistage:ensure' 
    * 2016-06-01 16:30:26 executing `deploy' 
    * 2016-06-01 16:30:26 executing `deploy:update' 
** transaction: start 
    * 2016-06-01 16:30:26 executing `deploy:update_code' 
    executing locally: "git ls-remote [email protected]:mitigation/mpm.git r1" 
    command finished in 662ms 
    * refreshing local cache to revision 8c86d067abde1464f88902566324a99e22cd3147 at /var/folders/xs/5qz1glwj30v51rwpxhyclw880000gn/T/mpm 
    executing locally: cd /var/folders/xs/5qz1glwj30v51rwpxhyclw880000gn/T/mpm && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 8c86d067abde1464f88902566324a99e22cd3147 && git clean -q -d -x -f 

fatal: Not a git repository (or any of the parent directories): .git 

command finished in 13ms 
shell command failed with return code pid 52560 exit 128 

はここに私のCapfileです:

load 'deploy' 
load 'deploy/assets' 
load 'config/deploy' 

は、ここに私のDEPLOY.RBです:

require 'soprano' 

require 'bundler/capistrano' 

require 'capistrano/ext/multistage' 

require 'whenever/capistrano' 

require 'leipreachan/capistrano2' 

set :default_environment, { 
    'PATH' => '/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:$PATH' 
} 


set :web_server, :nginx 
set :keep_releases, 3 

set :repository, '[email protected]:mitigation/mpm.git' 

set :deploy_via, :copy 
set :copy_exclude, %w(.git .idea .yardoc tmp log .DS_Store doc/* public/uploads.tar db/*.sql vendor/cache) 
set :copy_cache, true 

set :bundle_without, [:development, :test] 
set :bundle_flags, '--deployment --binstubs' 

set :user, 'deploy' 

before 'deploy:setup', :db 
after 'deploy:create_symlink', 'utils:version' 
after 'deploy:update_code', 'db:symlink' 

#For troubleshooting only 
namespace :deploy do 
    task :update_code, :except => { :no_release => true } do 
    #on_rollback { run "rm -rf #{release_path}; true" } 
    strategy.deploy! 
    finalize_update 
    end 
end 
+0

私はあなたのcopy_excludeに.gitを除外して賭けました。おそらく一時ディレクトリにコピーしていますが、.gitを取得していないため、もはやレポとして保存されません。 – Kevin

+0

もう少し詳しいことを教えてください。私はcopy_excludeから.gitを削除しようとしましたが、それでも同じエラーがスローされます。私はそれをどうやって修正しようとしますか? –

答えて

0

さまざまな環境にデプロイするときに、capistrano3はディレクトリツリーを作成し、git情報をrepo_pathというフォルダに配置します。運用サーバー上のそのディレクトリ内を移動する必要があります。 "$ git log"は.git repoを示します。

copy_excludeに.gitは必要ありません。

capitrano3を別の環境用のアプリでもう一度設定することをお試しください。

関連する問題