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 environment list
TargetsAssigned target machines

The sort order determines the listed environment order:

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
  • A target assignment carries the tenant of whoever created it, regardless of whether the environment itself is global or tenant-owned. An assignment made by a global administrator (who has no tenant) is stored system-level, with no tenant, and is not confined to one tenant’s view
  • 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. A promotion or rollback into the environment runs targets with higher priority values first:

TargetPriorityOrder
web-180First
web-270Second
web-360Third
db-110Last

An ordinary deployment runs the targets its request names, in the order named, and does not use priority. See Target Selection.

  1. Open the Tenancy group in the top navigation, then the Environments pill
  2. Select an environment
  3. Click Manage Targets on the detail page
  4. In the Add Target form, choose one target from the Select Target dropdown
  5. Set its Priority (-100 to 100, higher is deployed first)
  6. Click Add Target, and repeat for each further target — the form assigns one at a time
  1. Open the environment detail page and click Manage Targets
  2. Find the target under Associated Targets
  3. Click the remove button on its row
  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 SkipSelects the blocking message when no direct rule matches; it does not permit a skip
  1. Open the Tenancy group in the top navigation, then the Environments pill
  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

There is no Variables tab on the solution detail page — the solution page links variable sets, it does not author variables. Environment-specific values are set on the variable itself, one variable per environment value:

  1. Go to Variable Sets and open (or create) a set
  2. Add a variable to the set
  3. Pick the environment in the Environment Scope select — that stores the variable’s scope_environment_id
  4. Enter the value for that environment and save
  5. Repeat for each environment, then open the solution’s detail page and use Link set in its Variable sets section so deployments of that solution resolve from it

Where two linked sets define the same variable name, the higher-priority link wins.

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