Does cloudControl have post-deploy hooks?

40 Views Asked by At

I'm looking for a way to notify external services after a deploy has finished on cloudControl, do they have post-deploy hooks and how are they set up?

2

There are 2 best solutions below

0
pst On

While certainly useful in some situations, we unfortunately currently do not support web-hooks.

As a workaround you could notify the external services either by calling a custom script during push or before/after starting of the application processes. The deployed Git hash is always available in the DEP_VERSION environment variable. Alternatively you can use the events in the deploy log cctrlapp APP_NAME/DEP_NAME log deploy to trigger custom actions.

0
sgotre On

You can build pre-deploy hooks when using composer.

Register them in your composer.json

https://gist.github.com/sgotre/7706650

And write you commands in a special class. https://gist.github.com/sgotre/7706500

It is good to know these hooks are executed on the build-server. There, you do not have access to DEP_VERSION and other environment variables