Auto deploy and deploy event.
I have a cloud with a PHP Application role, and i'm deploying a Symfony2 app.
I have created a symfony2 cookbook, with 2 recipes:
configure and deploy.
Indeed the deploy recipe should be executed when the app is
deployed and the configure recipe each time something change in the
cloud, and at deploy.
Here's what i have set on the Custom recipes tab of my PHP
role:
Configure event: symfony2::configure
Deploy event: symfony2::configure,
symfony2::deploy
When i have a running instance, and deploy my application, everything runs fine.
But when i create a new instance and boot it, the code is
checked out, but my recipes are not called.
If i add symfony2::configure, symfony2::deploy to the
setup event, my recipes fail as they are called
before the code is checked out.
So i'd like to know how i could execute my 2 recipes, at boot, after my code is checked out.
Thanks for you help guys
Support Staff 2 Posted by Jonathan Weiss on 25 Jan, 2012 10:33 AM
Unfortunately the way the setup currently works is by always doing our deployment at the end. Changing that would break a lot of existing setups. We will change that behavior in the future and offer an explicit upgrade path.
What do you need to run in symfony2::deploy? You can also leverage deploy hooks in the
deploy/directory, see http://wiki.opscode.com/display/chef/Deploy+Resource#DeployResource...3 Posted by adrien on 26 Jan, 2012 01:50 PM
I've been able to run what i had on the auto deploy with the deploy/before_symlink.rb hook.
But my configure recipes, that should run on the setup event, fail because the /src/www/{app}/shared/config dir is not yet created.
I guess i'll have to deploy manually each time i create a new instance.
Support Staff 4 Posted by Jonathan Weiss on 28 Jan, 2012 07:33 AM
If you remove your configure recipe from
setupbut leave it onconfigureyou should be good. After a successfulsetupall instances in a cluster get aconfigure, including the one just booted. So all your configuration should be correct and you don't need to manually deploy.5 Posted by adrien on 31 Jan, 2012 10:54 AM
How can i execute my custom recipes (or definitions) from the callbacks ?