Then how about this:

  before "deploy:code", :set_flag
  before "deploy:migrate", :first_time_stuff

  task :set_flag do
    set :first_time_deploy, true
  end

  task :first_time_stuff do
    if fetch(:first_time_deploy, false)
      # do your thing
    end
  end

- Jamis

On Oct 27, 2007, at 4:33 AM, Thomas Watson wrote:


Thanks for the repley...

This would of cause work, but I would love if there where an elegant
way to do it that also worked if we where to deploy to another
production environment later. With your solution we would have to
remember to add the before-hook again if we where to use the tasks in
another app later. But of cause this is a very far fetched scenario
and 99% of people could easily settle for the solution you
mentioned... but we all love writing beautiful code don't we? ;)

The only solution I've found so far would be to overwrite deploy:cold
in deploy.rb with my own version containing the custom task just
before the migrate part.

/watson

On Oct 27, 3:53 am, Jamis Buck <[EMAIL PROTECTED]> wrote:
If it's only the first one, why not just do

   before "deploy:migrate", :my_custom_task

And then remove it after the first deployment?

- Jamis


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to capistrano- [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/ group/capistrano
-~----------~----~----~----~------~----~------~--~---


Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to