[NEW FEATURE] Manage your Deployment Order with Qovery Deployment Pipeline

Hi everyone,

On behalf of my team, I am super excited to announce our Deployment Pipeline feature is globally available now! :tada:

What is a Deployment Pipeline?

From the documentation:

When an environment’s deployment is triggered, Qovery executes what we call the Deployment Pipeline. It basically defines which operation shall be performed to properly deploy every service defined within your environment (build, deploy, etc…)

A pipeline is composed of an ordered list of Deployment Stages. Each Stage has an execution order assigned within the pipeline: If stage A has an execution order lower than stage B then B can be executed only if the execution of stage A is completed.

Each service of your environment belongs to one (and only one) Deployment Stage. This allows you to define at which moment of the deployment pipeline a service should be deployed and thus respect any service inter-dependency (e.g. your front-end needs to be started after the back-end, your database needs to be started before your back-end etc…).

During the deployment, a service goes through the building and deployment phase (as explained here). The build and deploy operation of each service within a deployment stage can be executed in parallel (feature WIP)

How to configure your deployment order?

Web console

Note: to create or delete a stage, use the CLI at the moment.

CLI

  1. Install the Qovery CLI
  2. Authenticate yourself with qovery auth
  3. Set your context with qovery context set

List stages

You can list all the stages of your environment by using the following command:

qovery environment stage list

Add a stage

You can add a new stage by using the following command:

qovery environment stage create -n <name> -d <description>

Note that the stage will be added at the end of the pipeline (the highest number)

Modify a stage

You can modify a stage by using the following command:

qovery environment stage edit -n <original name> --new-name <new name> --new-description <new description>

Delete a stage

You can modify a stage by using the following command:

qovery environment stage delete -n <name>

Change stage for a service

You can modify the stage associated with a service by using the following command:

qovery environment stage move -n <service name> --stage <stage name>

Example

By default, Qovery creates default stages for each of your environments. E.g. I have an environment with 7 services, and here are the default stages.

~ $ qovery environment stage list

# deployment stage 1: "DATABASE DEFAULT"
Rename me to avoid default/legacy ordering

Type     | Name
DATABASE | Redis
DATABASE | DB


# deployment stage 2: "JOB DEFAULT"
Rename me to avoid default/legacy ordering

<no service>


# deployment stage 3: "CONTAINER DEFAULT"
Rename me to avoid default/legacy ordering

Type      | Name
CONTAINER | Rabbitmq


# deployment stage 4: "APPLICATION DEFAULT"
Rename me to avoid default/legacy ordering

Type        | Name
APPLICATION | Backend
APPLICATION | Frontend
APPLICATION | Pablo Backend App
APPLICATION | API gateway

The stages are DATABASE DEFAULT, JOB DEFAULT, CONTAINER DEFAULT and APPLICATION DEFAULT. So when I deploy this environment, the execution order will be:

  1. DATABASE DEFAULT → Redis and DB will be deployed
  2. JOB DEFAULT → this stage has no service, so it will be skipped
  3. CONTAINER DEFAULT → Rabbitmq will be built and deployed.
  4. APPLICATION DEFAULT → Backend, Frontend, Pablo Backend App and API Gateway will be built and deployed.

If I want to build and deploy my Backend app before Frontend, Pablo Backend App and API Gateway, I can re-order all of this.

First, I want to rename all the stages

~ $ qovery environment stage edit -n "DATABASE DEFAULT" --new-name "first stage"
Stage updated successfully
~ $ qovery environment stage edit -n "JOB DEFAULT" --new-name "second stage"
Stage updated successfully
~ $ qovery environment stage edit -n "CONTAINER DEFAULT" --new-name "third stage"
Stage updated successfully
~ $ qovery environment stage edit -n "APPLICATION DEFAULT" --new-name "fourth stage"
Stage updated successfully
~ $ qovery environment stage list

# deployment stage 1: "first stage"

Type     | Name
DATABASE | Redis
DATABASE | DB


# deployment stage 2: "second stage"

<no service>


# deployment stage 3: "third stage"

Type      | Name
CONTAINER | Rabbitmq


# deployment stage 4: "fourth stage"

Type        | Name
APPLICATION | Backend
APPLICATION | Frontend
APPLICATION | Pablo Backend App
APPLICATION | API gateway

Then I move Rabbitmq into the second stage and Backend into the third stage

~ $ qovery environment stage move -n Rabbitmq -s "second stage"
Application moved into stage "second stage"
~ $ qovery environment stage move -n Backend -s "third stage"
Application moved into stage "third stage"
~ $ qovery environment stage list

# deployment stage 1: "first stage"

Type     | Name
DATABASE | Redis
DATABASE | DB


# deployment stage 2: "second stage"

Type      | Name
CONTAINER | Rabbitmq


# deployment stage 3: "third stage"

Type        | Name
APPLICATION | Backend


# deployment stage 4: "fourth stage"

Type        | Name
APPLICATION | Frontend
APPLICATION | Pablo Backend App
APPLICATION | API gateway

And now I can deploy my environment, and the deployment orders will be respected :fire:

qovery environment deploy

If you want to create a new stage, you can run

qovery environment stage create -n "fifth stage"

Resources


UPDATE: Deployment Order is now available on the Web UI

If you have any questions, feel free to drop your comment below

3 Likes

Hi,
is it possible to handle the deployement order on the same stage.
For example i want :

  1. Build Back-end A and Back-end B
  2. Deploy Back-end A before Back-end B

Thanks !

Hi @Nicolas_Hernandez , thanks for your question. What’s your requirement for building apps A and B and then deploying apps A and B?

I use nginx and php-fpm to avoid an error on nginx on start i need to have php-fpm deployed and available.
So i want build nginx and php-fpm and deploy php-fpm and nginx when php is deployed

1 Like

Ok I understand, does it make sense to use PHP-FPM and NGINX in the same instance instead of two services in your case?

Update: Deployment Order feature is GA :partying_face:

1 Like

this is the dilemma I currently have and I tend to keep my service separation easier to maintain, identify and scale instead of having one service that has two roles

But thanks for you answer for now my services are deployed in good order

1 Like

Here is this feature’s official announcement- some interesting info there.

Hi, I went through [Deployment Pipeline | Docs | Qovery] and trying to setup pipeline.
I have multiple services in the each stage and i want to reorder the services in the stage as well. Is it possible to re-order the services in a stage? It seems to arrange those services randomly every time i reload.
For example:

I have “stage a” and i have

  1. backend
    2.frontend

i want to reorder them like this in the same stage:

  1. frontend
    2.backend

Any help?