ruby on rails - capify-ec2 cap deploy:migrate db no servers matching -
i'm unable perform cap deploy:migrate
. , error message is:
2014-10-14 10:01:15 executing `deploy:migrate' executing "ls -x /home/pj-production/projectname/releases" `deploy:migrate' run servers matching {:roles=>:db, :only=>{:primary=>true}}, no servers matched
setup:
rails (3.2.13)
capistrano (2.14.2)
capify-ec2 (1.1.6)
cap ec2:status
project: projectname. num name id type dns zone roles 00: worker01 i-1 t1.micro ec2-x1.eu-west-1.compute.amazonaws.com eu-west-1b worker 01: db01 i-d m1.medium ec2-x2.eu-west-1.compute.amazonaws.com eu-west-1b 02: web01 i-f m1.medium ec2-x3.eu-west-1.compute.amazonaws.com eu-west-1b web,app,db
in deploy.rb:
ec2_roles name: :web, options: { default: true } ec2_roles name: :app, options: { default: true } ec2_roles name: :db, options: { default: true } ec2_roles name: :worker, options: { default: true }
there parts in deploy.rb
task :start, roles: :app run "cd #{current_path} && bundle exec unicorn -c config/unicorn/production.conf.rb -e production -d" end
works, illustration when perform a: cap deploy
, runs , finishes.
what problem? searched google , other questions in stack. couldnt run. i'm not using multistage btw , gist file of deploy.rb: https://gist.github.com/adogan/2121d312c5938746acd6
for ec2 instance roles: 'web,app,db' need add together 'options' tag in aws single value, 'primary'. equivalent having config/deploy/env.rb line:
role :db, "10.1.2.3", :primary => true
deploy works because skip db:migrate if there no boxes match role 'db' primary true. you're asking db:migrate, fail if there no boxes run on.
ruby-on-rails amazon-web-services deployment amazon-ec2 capistrano
No comments:
Post a Comment