Skip to content

Environments

An Environment is a logical grouping of targets that represents a stage in your deployment pipeline. Environments define where solutions are deployed and enable controlled promotion through your release process.

Environments organize your infrastructure into deployment stages:

Common environment examples:

EnvironmentPurpose
DevelopmentEarly testing, developer verification
TestQA testing, integration testing
StagingPre-production validation
ProductionLive customer-facing systems
PropertyDescription
NameEnvironment identifier (e.g., “Production”)
DescriptionOptional description
Sort OrderPosition in the promotion pipeline
TargetsAssigned target machines

The sort order determines environment progression:

EnvironmentSort OrderPosition
Development0First (deploy here first)
Test10Second
Staging20Third
Production30Last (final destination)

Environments in Mantis can be global (shared) or tenant-specific:

  • Global environments (tenant_id is unset) are visible to all tenants and provide a shared pipeline structure across your organization
  • Tenant-owned environments are visible only to the owning tenant and allow independent pipeline structures per tenant
  • Target assignments are always tenant-scoped, regardless of whether the environment itself is global or tenant-owned
  • Each tenant can have different targets assigned within any environment they can see

This model lets you standardize pipeline stages globally while still allowing tenants to manage their own target assignments and deployment state independently.

Targets are assigned to environments with a priority value:

Priority values range from -100 to 100 and default to 50. Targets with higher priority values deploy first:

TargetPriorityDeployment Order
web-180First
web-270Second
web-360Third
db-110Last

This is useful for:

  • Deploying web servers before database
  • Rolling out to canary servers first
  • Ensuring dependency order
  1. Navigate to Environments in the sidebar
  2. Select an environment
  3. Go to the Targets tab
  4. Click Add Target
  5. Select target(s) from the dropdown
  6. Set priority values
  7. Save
  1. Open the environment detail page
  2. Find the target in the list
  3. Click Remove
  4. Confirm removal

Each solution tracks its state per environment:

SolutionDevelopmentStagingProduction
Web Appv1.3.0v1.2.0v1.1.0
APIv2.1.0v2.1.0v2.0.0
Workerv1.0.0v1.0.0v1.0.0

State information includes:

  • Current Version - Deployed solution version
  • Deployed At - Timestamp of deployment
  • Deployed By - User who triggered deployment
  • Target Count - Number of targets in environment

Environments define the promotion path:

Administrators can configure promotion rules:

RuleDescription
Require SuccessPrevious deployment must succeed
Minimum Soak TimeWait period before promotion
Require ApprovalManual sign-off required
Allow SkipCan skip to later environments
  1. Navigate to Environments in the sidebar
  2. Click New Environment
  3. Enter name (e.g., “Staging”)
  4. Add optional description
  5. Set sort order (e.g., 20)
  6. Save

After creation, environments appear in sort order:

Development (0)
Test (10)
Staging (20)
Production (30)

To reorder, edit the sort order values.

  1. Click on an environment
  2. Update name, description, or sort order
  3. Save changes
  1. Click on an environment
  2. Click Delete
  3. Confirm deletion

Solutions can have environment-specific variable values:

VariableDevelopmentStagingProduction
db_hostdev-dbstaging-dbprod-db-cluster
log_leveldebuginfowarn
replicas125

Configure variables:

  1. Navigate to the solution detail page
  2. Go to Variables tab
  3. Select environment scope
  4. Enter environment-specific values
  5. Save

Keep environments meaningful and distinct:

GoodBad
Development, Staging, Productionenv1, env2, env3
Integration, Performance, Productiontest, test2, final

Ensure appropriate target counts:

EnvironmentPurposeTypical Targets
DevelopmentQuick iteration1-2
TestIntegration testing2-4
StagingProduction mirrorSame as prod
ProductionLive systemsAs needed

Use gaps in sort order for flexibility:

Development: 0
Test: 100
Staging: 200
Production: 300

This allows inserting Performance (150) or Pre-Prod (250) later.

Use clear, consistent names:

  • Capitalized: Production, Staging, Development
  • Or lowercase: production, staging, development
  • Avoid abbreviations: prod, stg, dev (unless universal)
EnvironmentSort OrderDescription
Development0Developer testing
Integration10Integration tests
QA20QA team testing
Staging30Pre-production
Production40Live systems
EnvironmentSort OrderDescription
Development0Single region dev
Staging-US10US staging
Staging-EU11EU staging
Production-US20US production
Production-EU21EU production