[chef] Re: Rationale behind deployment callbacks / hooks


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Rationale behind deployment callbacks / hooks
  • Date: Thu, 24 Jan 2013 08:09:42 -0800


On Thursday, January 24, 2013 at 6:42 AM, Loïc Antoine-Gombeaud wrote:

Hi chefs,

can somebody explain the rationale behind deployment callbacks, also called deployment hooks [1]? More precisely, I understand their purpose quite well (and use them myself), however I don't understand why they should be stored in the application code base instead of inside the cookbooks. 
According to Scalarium documentation [2], it is an inherited Capistrano behaviour, but that doesn't answer the question of location AFAICT.

The reasons I'm asking are the following:
- it's a pain to maintain deployment code in two distinct repositories, and
- I'm just curious :)
The deploy resource is a port of an earlier project that provided Capistrano-style deployment for Chef, developed and used at Engine Yard, and the intention was to provide compatibility with that implementation. You can imagine that in an Engine Yard type scenario, you may be able to fill in all the parameters to the deploy resource from information you have in a database or with sane defaults for your environment, while allowing some custom functionality via hooks that live in the code repo.

If you don't want to keep the callback code separate, you can just give blocks of Chef code to the callbacks instead of looking up the files.
 

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§