on cap deploy:cold ro cap deploy, triggered error
[out :: xxx.xxx.xxx.xxx] killed command finished in 9020ms *** [deploy:update_code] rolling * executing [#<capistrano::command::tree::elsebranch:0x00000100dc5478 @condition="else", @command="rm -rf /home/yasinishyn/apps/mkv/releases/20130506084016; true", @callback=#<proc:0x00000100dd5da0@/usr/local/rvm/gems/ruby-2.0.0-p0/gems/capistrano-2.15.3/lib/capistrano/configuration/actions/invocation.rb:13>, @options={}, @skip=false>] servers: ["xxx.xxx.xxx.xxx"] [xxx.xxx.xxx.xxx] executing command command finished in 386ms failed: "sh -c 'cd -- /home/yasinishyn/apps/mkv/releases/20130506084016 && bundle exec rake rails_env=production rails_groups=assets assets:precompile'" on xxx.xxx.xxx.xxx i have tryed many advises stack, nosing works me.
my deploy.rb
deploy.rb:
require "bundler/capistrano" server "xxx.xxx.xxx.xxx", :web, :app, :db, primary: true set :application, "app" set :user, "user" set :deploy_to, "/home/#{user}/apps/#{application}" set :deploy_via, :remote_cache set :use_sudo, false set :scm, "git" set :repository, "git@github.com:git_user/#{application}.git" set :branch, "master" default_run_options[:pty] = true ssh_options[:forward_agent] = true after "deploy", "deploy:cleanup" # keep last 5 releases namespace :deploy %w[start stop restart].each |command| desc "#{command} unicorn server" task command, roles: :app, except: {no_release: true} run "/etc/init.d/unicorn_#{application} #{command}" end end task :setup_config, roles: :app sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}" sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}" run "mkdir -p #{shared_path}/config" put file.read("config/database.example.yml"), "#{shared_path}/config/database.yml" puts "now edit config files in #{shared_path}." end after "deploy:setup", "deploy:setup_config" task :symlink_config, roles: :app run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" end after "deploy:finalize_update", "deploy:symlink_config" desc "make sure local git in sync remote." task :check_revision, roles: :web unless `git rev-parse head` == `git rev-parse origin/master` puts "warning: head not same origin/master" puts "run `git push` sync changes." exit end end before "deploy", "deploy:check_revision" #rake seed task desc "seed database on deployed code" task :seed, :only => {:primary => true}, :except => { :no_release => true } run "cd #{current_path}; rails_env=#{rails_env} bundle exec rake db:seed" end desc "seed database on deployed code" task :drop, :only => {:primary => true}, :except => { :no_release => true } run "cd #{current_path}; rails_env=#{rails_env} bundle exec rake db:drop:all" run "cd #{current_path}; rails_env=#{rails_env} bundle exec rake db:create:all" run "cd #{current_path}; rails_env=#{rails_env} bundle exec rake db:migrate" end end in production.rb have
config.assets.compress = true and capfile
load 'deploy' # uncomment if using rails' asset pipeline load 'deploy/assets' dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } load 'config/deploy' # remove line skip loading of default tasks local precompile "bundle exec rake assets:precompile rails_env=production --trace" executes without errors.
where mistake? hot debug it? or maybe somewhere log file capistano in can more details?
i find answer own
delete "load 'deploy/assets'" capfile, , run
cap deploy:cold this work without error, on initial deploy. usual "sudo service nginx restart" on server, , add deleted snippet.
and bamm!! works :)
Comments
Post a Comment