Missing documentation on and code examples of webhooks and build hooks

Hey there,

at the moment, I am trying to setup a Gatsby.js website. I used the node.js static preset.
The website is receiving data from a CMS and getting a lot of images (currently 600 MB).
A webhook is triggering a new deployment.

The problem now is that with every deployment a new version of the website is created in a new release folder which really stresses the CPU and harddrive.
Gatsby.js normally tries to cache external data to not reload every single data bite.
This is not possible with the default build hooks.

Wished behavior:

  • Full deployment without cache when new commit is available.
  • Partial deployment with cached data when webhook is triggering a build.
    => On new commit copy from branch else copy from last version (with cache).

Questions:

  • Can I differentiate between deployments triggered by git vs webhook (cms).
  • Can you provide all default build hooks in your repo to help the community to build own hooks.
  • Is there a way to remove or cancel deployments programmatically? (example: if the last deployment is still running and not long ago, a new deployment via webhook could cancel it — otherwise there would be deployments for every save button clicked in the cms)

#webhook #cache #hook

Hi @Matthi and you fantastic Cleavr guys,

Yes, a lot of code examples would be great.

I’m all good now but since my intention is to use Cleavr for a long time if not for ever i’m sure i some day will find my self in Matthi’s position.

Have a great weekend

1 Like

I just want to follow-up here.
Is it possible to answer these questions?

Or did I not write it clear enough (sorry, I am not a native speaker :grimacing:)?

Hello @Matthi,

Sorry for the late response.

There is not a way to differentiate the deployments as of now.

We always wanted to get this done but because of some other tickets with higher priorities we have not been able to work on it. We’re planning on working on a feature that allows users to update the deployment script and run the deployment.

We have a library of scripts/hooks available in the following repo:

It is in our backlog as well, in case of multiple deployments users will have a setting to run sequentially all the deployments or deploy the latest one only.

Your points are valid and we always wanted to approach them. I’ll bring this to the next team meeting and see how we can plan them in the next sprint.

We’ll keep you updated. Once again sorry for the late response.

Please let me know if you have any other queries.