Jamis Buck wrote:
> On Jan 23, 2007, at 2:13 AM, jeroen wrote:
>
>   
>> Hi Jamis,
>>
>> It sure is helpful info. However it doesn't completely answer my
>> question. My question is more like: how can I can I make sure the
>> :repository var *only* changes when I do a deploy or
>> deploy_with_migrations?
>>     
>
> What about update_code? You don't want it to change when that task is  
> run? Or diff_from_last_deploy? There are actually several tasks that  
> (directly or indirectly) hit the repository variable.
>
> However, if you only want that variable to be changed ONLY for those  
> two tasks, then you can implement a before hook for them:
>
>    def set_repository_variable
>      # set up the :repository variable
>    end
>
>    task :before_deploy do
>      set_repository_variable
>    end
>
>    task :before_deploy_with_migrations do
>      set_repository_variable
>    end
>
> Does that work for you?
>   
I have to try it but it sounds perfect! I didn't know these hooks existed.

The goal is to force developers to deploy a tagged release. I can add a 
bit of code that checks for a version variable and if it's not present, 
cap should exit with an error msg. I guess altering the update_code will 
do the trick but I don't want to make it impossible to update the code 
from /trunk.

Jeroen


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

Reply via email to