ec2 and multistage

4 views
Skip to first unread message

phillee

unread,
Aug 22, 2009, 2:30:52 PM8/22/09
to ec2-on-rails-discuss
I'm running ec2onrails with the multistage plugin. I think there's
some problems with the stage file under config/deploy/stage_name.rb
not loaded properly. I found some results on moving the "require
'ec2onrails/recipes'" around, but that doesn't seem to work. Help
appreciated!

$ cap ec2onrails:setup
triggering start callbacks for `ec2onrails:setup'
* executing `multistage:ensure'
*** Defaulting to `staging'
* executing `staging'
* executing `ec2onrails:setup'
* executing `ec2onrails:server:update_hostname'
* executing "sudo -p 'sudo password: ' /usr/local/ec2onrails/bin/
update_hostname"
`ec2onrails:server:update_hostname' is only run for servers matching
{:roles=>[]}, but no servers matched

Denis Haskin

unread,
Aug 22, 2009, 10:12:51 PM8/22/09
to ec2-on-rai...@googlegroups.com
I tried to use multistage, without success as well.  As far as I can tell it's not compatible.  Here's what I currently have in deploy.rb:

# From Paul Downman's comment in the google group, 2008-07-24
set :config, ENV['config'] || 'staging'
environment = ENV['config'] || 'staging'
load "#{File.dirname(__FILE__)}/deploy/#{config}.rb"

# Don't use this; ec2onrails doesn't play nice with multistage
# set :stages, %w(staging production)
# set :default_stage, "production"
# require File.expand_path("#{File.dirname(__FILE__)}/../vendor/gems/capistrano-ext-1.2.1/lib/capistrano/ext/multistage")

I can't find Paul's comment that I referred to above... but Google groups seems a little wonky right now.

dwh



bploetz

unread,
Aug 23, 2009, 1:03:23 AM8/23/09
to ec2-on-rails-discuss
It works for me with the following hack (which I believe I found
somewhere on this group):

Place the following in config/deploy.rb:

set :stages, %w(staging production) # define your stages here
set :default_stage, "staging"
require 'capistrano/ext/multistage'

set :ec2onrails_config, {}



Then, place the contents of ec2onrails' examples/deploy.rb (tailored
to your app of course) into config/deploy/{stage}.rb.

Philip Lee

unread,
Aug 23, 2009, 1:12:28 AM8/23/09
to ec2-on-rai...@googlegroups.com
This worked for me. Thanks!

bploetz

unread,
Aug 23, 2009, 1:19:02 AM8/23/09
to ec2-on-rails-discuss
Forgot an important bit. You have to move this to the bottom of your
stage files (after the :ec2onrails_config hash):

require 'ec2onrails/recipes'


And you invoke tasks like so:

cap {stage} {task}

i.e.

cap staging deploy:web:disable

Here's the original thread for reference:

see
http://www.google.com/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fmarkmail.org%2Fmessage%2Fabgvug3jzjfpuleq&ei=_04ESu_aK86ptgeOo-n5Bg&rct=j&q=ec2onrails%2C+multistage%2C+ec2onrails_config&usg=AFQjCNHBnej4yLRSw3kOs4ieGLNNii4CRQ&sig2=wLHTbetGWa3SMSkybQUmSw

Denis Haskin

unread,
Aug 23, 2009, 6:30:51 PM8/23/09
to ec2-on-rai...@googlegroups.com
Interesting -- I may have to try this again.

Thanks,

dwh

Reply all
Reply to author
Forward
0 new messages