How to reduce the number of deployments in monorepo?

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.