I had the same idea, but then I found that default Capfile (https://github.com/capistrano/capistrano/blob/v3/lib/capistrano/templates/Capfile) contains tasks.
On Tuesday, August 6, 2013 3:11:27 AM UTC+4, dbray wrote: > > The Capfile is an odd choice to put tasks of any description IMO. Capfile > should have only the things that make the cap cli work the way you want. It > should be seldom looked at and modified even less. > > Otherwise tasks should be in config/deploy.rb or a require inside thereof. > > Someone new to your cap scripts should be able to start at > config/deploy.rb to get an idea of what it's about and not get surprised by > a bunch of code that got put in the Capfile. > > > On Aug 5, 2013, at 3:36 PM, Jonathan Rochkind <[email protected]<javascript:>> > wrote: > > > Thanks! First thing I'm confused about is the right place to put > stage-specific logic now: > > > > **** > > 5. Capistrano 3.x has changed structure of recepies. Before that you put > stage-specific code to config/deploy/stage_name.rb, but now > config/deploy.rb should contain only global options for all stages. Tasks > like restarting Unicorns and preparing configs should now be placed in > Capfile. > > > > Now you need to refactor your old deploy.rb (also Capfile, but in most > of cases developers didn't change it in Capistrano 2.x). Move parameters > (like set :deploy_to, "/home/deploy/#{application}" or set :keep_releases, > 4) to config/deploy.rb and tasks to Capfile. > > **** > > > > Okay, so if I have tasks that run only under 'staging', or varible > definitions that only apply to 'staging', I do NOT any longer put them in > config/deploy/staging.rb? > > > > Instead, I put them in.... ./Capfile? I don't understand how I can > define settings (definition of tasks or variable) that will only apply to > certain stages in the Capfile. An example might be helpful here? The most > basic example, that everyone will need, is how to define your > stage-specific hostnames. > > > > Jonathan > > > > On 8/5/13 6:24 PM, Kir S. wrote: > >> Sure! > >> v.3 > >> announcement: > http://www.capistranorb.com/2013/06/01/release-announcement.html > >> upgrading guide: http://www.capistranorb.com/documentation/upgrading/ > >> > >> On Wednesday, July 10, 2013 1:13:39 AM UTC+4, Jonathan Rochkind wrote: > >> > >> Nice to see this is close! Is there a document on differences > >> between v2 > >> and v3, a guide to what you're going to have to deal with in trying > to > >> upgrade? > >> > >> On 7/9/13 4:33 PM, Lee Hambley wrote: > >> > Not possible with v2, see the release announcement at > >> > http://capistranorb.com - v3 will be the main release within a > >> few days, > >> > you can already use it. > >> > > >> > On Tuesday, July 9, 2013, Carlos Pe�as wrote: > >> > > >> > There's a lot of questions arround this topic and I feel that > >> > there's no direct solution. > >> > > >> > Is there a way to get the current role name for a task to use > >> it in > >> > a variable? > >> > > >> > This is what I'm trying to acomplish > >> > > >> > task upload_different_file do > >> > upload > >> > > >> "server_cfg/#{stage}/*#{computed_role}*/my_custom_and_needed_file" > >> > "/tmp" > >> > run "echo *#{computed_role}* >> > >> /tmp/fancy_roles_enumeration" > >> > ... and the like ... > >> > end > >> > > >> > That's it. The role name should be arbitrary because this is > >> planed > >> > to upload several files to a server, based on its role > declared > >> > > >> > I know that if there's a server with two roles calling twice > >> to that > >> > kind of task, it will lead to file collision, but I will > >> handle that > >> > later. > >> > > >> > Is this posibble? > >> > > >> > Thanks > >> > > >> > . > >> > > >> > -- > >> > -- > >> > * You received this message because you are subscribed to the > >> Google > >> > Groups "Capistrano" group. > >> > * To post to this group, send email to > [email protected] > >> > * To unsubscribe from this group, send email to > >> > [email protected] For more options, visit this > >> > group at http://groups.google.com/group/capistrano?hl=en > >> <http://groups.google.com/group/capistrano?hl=en> > >> > --- > >> > You received this message because you are subscribed to the > >> Google > >> > Groups "Capistrano" group. > >> > To unsubscribe from this group and stop receiving emails from > >> it, > >> > send an email to [email protected]. > >> > For more options, visit > >> https://groups.google.com/groups/opt_out > >> <https://groups.google.com/groups/opt_out>. > >> > > >> > > >> > > >> > > >> > -- > >> > Lee Hambley > >> > -- > >> > http://lee.hambley.name/ > >> > +49 (0) 170 298 5667 > >> > > >> > -- > >> > -- > >> > * You received this message because you are subscribed to the > Google > >> > Groups "Capistrano" group. > >> > * To post to this group, send email to [email protected] > >> > * To unsubscribe from this group, send email to > >> > [email protected] For more options, visit this > >> > group at http://groups.google.com/group/capistrano?hl=en > >> <http://groups.google.com/group/capistrano?hl=en> > >> > --- > >> > You received this message because you are subscribed to the > Google > >> > Groups "Capistrano" group. > >> > To unsubscribe from this group and stop receiving emails from it, > >> send > >> > an email to [email protected]. > >> > For more options, visit https://groups.google.com/groups/opt_out > >> <https://groups.google.com/groups/opt_out>. > >> > > >> > > >> > >> -- > >> -- > >> * You received this message because you are subscribed to the Google > >> Groups "Capistrano" group. > >> * To post to this group, send email to > >> [email protected]<javascript:> > >> * To unsubscribe from this group, send email to > >> [email protected] <javascript:> For more options, visit > this > >> group at http://groups.google.com/group/capistrano?hl=en > >> --- > >> You received this message because you are subscribed to the Google > >> Groups "Capistrano" group. > >> To unsubscribe from this group and stop receiving emails from it, send > >> an email to [email protected] <javascript:>. > >> For more options, visit https://groups.google.com/groups/opt_out. > >> > >> > > > > -- > > -- > > * You received this message because you are subscribed to the Google > Groups "Capistrano" group. > > * To post to this group, send email to > > [email protected]<javascript:> > > * To unsubscribe from this group, send email to > [email protected] <javascript:> For more options, visit > this group at http://groups.google.com/group/capistrano?hl=en > > --- You received this message because you are subscribed to the Google > Groups "Capistrano" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- -- * You received this message because you are subscribed to the Google Groups "Capistrano" group. * To post to this group, send email to [email protected] * To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano?hl=en --- You received this message because you are subscribed to the Google Groups "Capistrano" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
