How to reduce the number of deployments in monorepo?

We hooked up multiple apps on Qovery to a single monorepo. Now every merge to master triggers the deployment of all the apps. Even in a small team we were able to reach 100 deployment limit in 15 days and had to upgrade to a paid plan. This is going to create problems as we grow. Is there a way for Qovery to check if there were changes in the specified path before triggering deploy?

Also, I think you should reconsider your pricing. The current model motivates people to deploy less which doesn’t feel right. The per-user model most other services chose seems to make more sense.

You can indicate to Qovery what are the applications that must be redeployed when a file has been modified. Today, it’s only configurable via our API but it will be integrated into Qovery v3 (GA for September 2022).

Example

Here is an example of what you can do. Let’s say you have 2 applications:

  • app-1 and app-2 are in the same repository
  • app-1 is located in /app-1
  • app-2 is located in /app-2

What I want is:

  • If a file has been modified from /app-1/*, then only my App 1 on Qovery is redeployed.
  • If a file inside /app-2/* has been modified, then only my App 2 on Qovery is redeployed.

Get an API token

First, to get access to the API, generate an API token via the CLI with qovery token.

API requests

For app-1 we need to execute the following API query:

curl -X POST -H "Authorization: Token <your_api_token>" -d "{ \
  "mode": "MATCH", \
  "type": "PATH", \
  "value": "app-1/" \
}" https://api.qovery.com/application/:app-1-id/deploymentRestriction

For app-2 we need to execute the following API query:

curl -X POST -H "Authorization: Token <your_api_token>" -d "{ \
  "mode": "MATCH", \
  "type": "PATH", \
  "value": "app-2/" \
}" https://api.qovery.com/application/:app-2-id/deploymentRestriction

Please find the complete API documentation here.

That’s it! :slight_smile: Hope it helps.


We make generous annual plan with good discount - contact us via Intercom to get a quote.

Hi @rophilogene
Just wanted to check, if this feature deploymentRestriction has been released for GA (as mentioned for September 2022) or if it can be utilized from the Qovery dashboard/UI?

Thank you.

Hi @shaider , unfortunately, not yet; it will be integrated into the v3 as soon as we release it and finish the ongoing work.

Hi @rophilogene
Thank you for the update.

I wrote this little Python script for our monorepos a few months ago, it might help:

It makes sure that all applications in the current project (selected through the Qovery CLI) have deployment restrictions added to their root path. :slight_smile:

1 Like