Jenkins
Using Jenkins with Qovery is super powerful and gives you the ability to manage the way that you want to deploy your applications. As the possibility are endless, I will share with you a couple of examples that you can use. Feel free to adapt them to your need.
Prerequisites
Before using the examples below, you need to:
- Install the Qovery CLI.
- Generate an API token via the CLI or the Console .
- Set the environment variable
Q_CLI_ACCESS_TOKEN
orQOVERY_CLI_ACCESS_TOKEN
(both are valid) with your API token. E.g.export QOVERY_CLI_ACCESS_TOKEN=your-api-token
- You have turned off the Qovery Auto Deployment for every service that you want to deploy manually.
Jenkins Examples
Since Jenkins also provides a .yaml file to configure your pipeline. Refers to GitLab CI and GitHub Actions examples to learn how to configure your pipeline with Qovery.
Qovery CLI command examples
Deploy your application with a specific commit ID
qovery application deploy \--organization <your_org_name> \--project <your_project_name> \--environment <your_environment_name> \--application <your_app_name> \--commit-id <your_commit_id> \--watch
Deploy your multiple applications with a different commit ID
# deploy the application 1 and wait for the deployment to be successful with the --watch argumentqovery application deploy \--organization <your_org_name> \--project <your_project_name> \--environment <your_environment_name> \--application <your_app_1_name> \--commit-id <your_commit_id> \--watch# deploy the application 2 and wait for the deployment to be successful with the --watch argumentqovery application deploy \--organization <your_org_name> \--project <your_project_name> \--environment <your_environment_name> \--application <your_app_2_name> \--commit-id <your_commit_id> \--watch
This is also applicable for the qovery container deploy
, qovery lifecycle deploy
, and qovery cronjob deploy
commands.
Deploy your multiple applications with a specific commit ID (monorepo)
# deploy the application 1, 2 and 3 with the same commit ID and wait for the deployment to be successful with the --watch argumentqovery application deploy \--organization <your_org_name> \--project <your_project_name> \--environment <your_environment_name> \--applications "<app_1_name>, <app_2_name>, <app_3_name>" \--commit-id <your_commit_id> \--watch
This is also applicable for the qovery container deploy
, qovery lifecycle deploy
, and qovery cronjob deploy
commands.
Create a Preview Environment for your Pull-Request
Qovery integrates automatically with GitHub, GitLab and Bitbucket to create a Preview Environment for each Pull-Request. But in case you want to control the creation of the Preview Environment manually, you can use the following commands:
# Clone your base environmentqovery environment clone \--organization <your_org_name> \--project <your_project_name> \--environment <your_environment_name> \--new-environment-name <your_new_environment_name># Change your application branch to the Pull-Request branchqovery application update \--organization <your_org_name> \--project <your_project_name> \--environment <your_new_environment_name> \--application <your_app_name> \--branch <your_pull_request_branch_name># Deploy your new environmentqovery environment deploy \--organization <your_org_name> \--project <your_project_name> \--environment <your_new_environment_name> \--watch
Delete a Preview Environment
qovery environment delete \--organization <your_org_name> \--project <your_project_name> \--environment <your_preview_environment_name> \--watch
Terraform
Do you want to include Terraform in your CI? Check out our Terraform documentation.
Any other examples?
Feel free to share your examples with us, and we'll be happy to share them with the community. Contact us on our forum.