Skip to main content

Overview

Manage environments and their lifecycle within your Qovery project.

Commands

List Environments

List all environments in current project:
qovery environment list
FlagDescription
--organizationOrganization Name
--projectProject Name
--jsonJSON output

Deploy Environment

Deploy all services in an environment:
qovery environment deploy --environment "env-name"
Deploy with specific services or versions:
qovery environment deploy \
  --environment "env-name" \
  --applications "app1:commit_id,app2:commit_id" \
  --watch
FlagDescription
--organizationOrganization Name
--projectProject Name
--environmentEnvironment Name
--servicesServices to deploy (JSON Format: https://api-doc.qovery.com/#tag/Environment-Actions/operation/deployAllServices)
--applicationsApplications to deploy e.g. app1:commit_id,app2:commit_id. Omit commit id to use the same commit.
--containersContainers to deploy e.g. container1:image_tag,container2:image_tag. Omit image tag to use the same tag.
--lifecyclesLifecycle jobs to deploy e.g. job1:image_tag|git_commit_id,job2:.... Omit version to use the same.
--cronjobsCronjobs to deploy e.g. cronjob1:git_commit_id,cronjob2:git_commit_id. Omit commit id to use the same.
--helmsHelm charts to deploy e.g. helm1:chart_version|git_commit_id,helm2:.... Omit version to use the same.
--watch / -wWatch environment status until it’s ready or an error occurs
--skip-paused-servicesSkip paused services: paused services won’t be started / deployed

Stop Environment

Stop all services in an environment:
qovery environment stop --environment "env-name"
FlagDescription
--organizationOrganization Name
--projectProject Name
--environmentEnvironment Name
--watch / -wWatch environment status until it’s ready or an error occurs

Cancel Environment Deployment

Cancel an ongoing environment deployment:
qovery environment cancel --environment "env-name"
FlagDescription
--organizationOrganization Name
--projectProject Name
--environmentEnvironment Name
--force / -fForce cancel
--watch / -wWatch environment status until it’s ready or an error occurs

Delete Environment

Delete an environment:
qovery environment delete --environment "env-name"
FlagDescription
--organizationOrganization Name
--projectProject Name
--environmentEnvironment Name
--watch / -wWatch environment status until it’s ready or an error occurs

Update Environment

Update an environment’s name or type:
qovery environment update \
  --environment "env-name" \
  --name "new-name"
FlagDescription
--organization / -oOrganization Name
--project / -pProject Name
--environment / -eEnvironment Name
--nameNew Environment Name
--typeChange Environment Type (DEVELOPMENT|STAGING|PRODUCTION)

Clone Environment

Clone an existing environment:
qovery environment clone \
  --environment "production" \
  --new-environment-name "staging-clone"
FlagDescription
--organization / -oOrganization Name
--project / -pProject Name
--environment / -eEnvironment Name to clone
--new-environment-name / -nNew Environment Name (required)
--cluster / -cCluster Name where to clone the environment
--environment-type / -tEnvironment type for the new environment (DEVELOPMENT|STAGING|PRODUCTION)
--apply-deployment-ruleEnable applying deployment rules on the new environment instead of having a pristine clone
--target-projectTarget Project Name

Examples

Deploy Environment

# Set context
qovery context set

# Deploy all services and watch
qovery environment deploy \
  --environment "my-env" \
  --watch

# Deploy specific applications with specific commits
qovery environment deploy \
  --environment "my-env" \
  --applications "api:abc1234,frontend:def5678" \
  --watch

Cancel a Deployment

# Cancel current deployment
qovery environment cancel --environment "my-env"

# Force cancel and watch
qovery environment cancel \
  --environment "my-env" \
  --force \
  --watch

Clone Production to Staging

# Clone environment
qovery environment clone \
  --environment "production" \
  --new-environment-name "staging-test" \
  --environment-type STAGING

# Clone to a different project and cluster
qovery environment clone \
  --environment "production" \
  --new-environment-name "staging-test" \
  --target-project "other-project" \
  --cluster "staging-cluster"

# Deploy cloned environment
qovery environment deploy --environment "staging-test"

Update Environment

# Rename an environment
qovery environment update \
  --environment "old-name" \
  --name "new-name"

# Change environment type
qovery environment update \
  --environment "my-env" \
  --type PRODUCTION