Hi Gerhardus,
If you install capistrano-multistage you will put common tasks and
variables in config/deploy.rb then for every stage you should have a
file in config/deploy/<stage_name.rb>. In the stage files you should
write specific variables and tasks of this stage.
Example(code not valid):
== config/deploy.rb
##
# Common parameters between stages
#
set :application, "foo"
ssh_options[:config] = false
set :use_sudo, false
set :keep_releases, 3
set :rails_env, "production"
## HERE DEFINES YOUR STAGES
# You can put theses lines at the begining
set :stages, %w(development staging production)
set :default_stage, "production"
require 'capistrano/ext/multistage'
##
##
# Common variables
#
set :config_files_array, %w(database.yml initializers/mailer.rb
initializers/local_config.rb)
set :assets_array, %w(public/photos tmp/pdf)
...
##
# Dependencies
#
depend :remote, :gem, "mysql", ">=2.7"
...
##
# Common tasks
#
...
== config/deploy/development.rb
set :user, "foo_development"
set :repository, "https://myrepository.net/foo/bar"
set :deploy_via, :export
set :deploy_to, "/home/#{user}"
##
# Specific tasks or parameters
#
...
== config/deploy/production.rb
set :user, "foo"
set :repository, "https://myrepository.net/foo/bar"
set :deploy_via, :export
set :deploy_to, "/var/rails_apps/#{applicaton}/#{user}"
##
# Specific tasks or parameters
#
...
Gerhardus Geldenhuis wrote:
> Hi Lee,
> To be perfectly frank not very far.
>
> I don't know how to incorporate "multistage" in my application. Unless
> the stages you define correspond to roles defined and the the task
> gets executed automatically against that role.
>
> Regards
>
> On Jan 23, 4:32 pm, Lee Hambley <[email protected]> wrote:
>
>> Hi Gerhardus,
>> Where are you upto so far?
>>
>> - Lee
>>
>> 2009/1/23 Gerhardus Geldenhuis <[email protected]>
>>
>>
>>
>>
>>> Hi am reading through the archives at the moment and am missing some
>>> good examples of how to actually use multistage.
>>>
>>> I realized that I have no idea what to do further other defining my
>>> stages.
>>>
>>> Regards
>>>
>>> On Jan 23, 3:12 pm, Gerhardus Geldenhuis
>>> <[email protected]> wrote:
>>>
>>>> Hi
>>>> I have been doing some reading about how to implement multistaging but
>>>> I am not sure which route I should be following. I would really
>>>> appreciate some advice/thoughts.
>>>>
>>>> I have found Multistage:
>>>>
>>> http://weblog.jamisbuck.org/2007/7/23/capistrano-multistage
>>>
>>>> and another possible methodhttp://www.egtheblog.com/?p=thatjust sets a
>>>>
>>> env variable and then
>>>
>>>> sets your server list based on this variable. This is the method I
>>>> like most at the moment...
>>>>
>>>> We have demo, development, production and load testing environments.
>>>> The method of deploying new applications does not differ between
>>>> environment, except for the different parameters that download the
>>>> applications. I also want to implement sequential implementation in
>>>> production at a later stage. We have a number of different
>>>> applications but all of them use the same deployment technique.
>>>>
>>>> I am unsure how I should be mapping this out with roles etc on my
>>>> tasks, I want all roles to be able to run task A but I don't want task
>>>> A to run for all roles when I don't specify the environment.
>>>>
>>>> I guess multistage could be used here and defining stages in the
>>>> following way:
>>>> Demo-AppA
>>>> Demo-AppB
>>>> Prod-AppA
>>>> Prod-AppB
>>>> etc...
>>>>
>>>> I like the fact that multstage will prompt you if you don't specify a
>>>> environment which makes a lot safer for me.
>>>>
>>>> Generally applications run on a dedicated server but there will be
>>>> some server sharing between applications.
>>>>
>>>> I would appreciate any thoughts, tips, caveats or source examples.
>>>> This email is also serving as a way for me to formalize my thoughts a
>>>> bit more.
>>>>
>>>> Regards
>>>>
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---
begin:vcard
fn;quoted-printable:Rafael Garc=C3=ADa Ortega
n;quoted-printable:Garc=C3=ADa Ortega;Rafael
org:ASPgems S.L.
email;internet:[email protected]
tel;work:692686533
x-mozilla-html:FALSE
url:http://www.aspgems.com
version:2.1
end:vcard