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.
What is an Environment?
Section titled “What is an Environment?”Environments organize your infrastructure into deployment stages:
Common environment examples:
| Environment | Purpose |
|---|---|
| Development | Early testing, developer verification |
| Test | QA testing, integration testing |
| Staging | Pre-production validation |
| Production | Live customer-facing systems |
Environment Properties
Section titled “Environment Properties”| Property | Description |
|---|---|
| Name | Environment identifier (e.g., “Production”) |
| Description | Optional description |
| Sort Order | Position in the environment list |
| Targets | Assigned target machines |
Sort Order
Section titled “Sort Order”The sort order determines the listed environment order:
| Environment | Sort Order | Position |
|---|---|---|
| Development | 0 | First (deploy here first) |
| Test | 10 | Second |
| Staging | 20 | Third |
| Production | 30 | Last (final destination) |
Environment Scope
Section titled “Environment Scope”Environments in Mantis can be global (shared) or tenant-specific:
- Global environments (
tenant_idis 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.
Target Assignment
Section titled “Target Assignment”Targets are assigned to environments with a priority value:
Priority Ordering
Section titled “Priority Ordering”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:
| Target | Priority | Order |
|---|---|---|
| web-1 | 80 | First |
| web-2 | 70 | Second |
| web-3 | 60 | Third |
| db-1 | 10 | Last |
An ordinary deployment runs the targets its request names, in the order named, and does not use priority. See Target Selection.
Assigning Targets
Section titled “Assigning Targets”- Open the Tenancy group in the top navigation, then the Environments pill
- Select an environment
- Click Manage Targets on the detail page
- In the Add Target form, choose one target from the Select Target dropdown
- Set its Priority (-100 to 100, higher is deployed first)
- Click Add Target, and repeat for each further target — the form assigns one at a time
Removing Targets
Section titled “Removing Targets”- Open the environment detail page and click Manage Targets
- Find the target under Associated Targets
- Click the remove button on its row
- Confirm removal
Environment State
Section titled “Environment State”Each solution tracks its state per environment:
| Solution | Development | Staging | Production |
|---|---|---|---|
| Web App | v1.3.0 | v1.2.0 | v1.1.0 |
| API | v2.1.0 | v2.1.0 | v2.0.0 |
| Worker | v1.0.0 | v1.0.0 | v1.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
Promotion Flow
Section titled “Promotion Flow”Environments define the promotion path:
Promotion Rules (Optional)
Section titled “Promotion Rules (Optional)”Administrators can configure promotion rules:
| Rule | Description |
|---|---|
| Require Success | Previous deployment must succeed |
| Minimum Soak Time | Wait period before promotion |
| Require Approval | Manual sign-off required |
| Allow Skip | Selects the blocking message when no direct rule matches; it does not permit a skip |
Creating Environments
Section titled “Creating Environments”In the UI
Section titled “In the UI”- Open the Tenancy group in the top navigation, then the Environments pill
- Click New Environment
- Enter name (e.g., “Staging”)
- Add optional description
- Set sort order (e.g., 20)
- Save
Environment Ordering
Section titled “Environment Ordering”After creation, environments appear in sort order:
Development (0)Test (10)Staging (20)Production (30)To reorder, edit the sort order values.
Managing Environments
Section titled “Managing Environments”Editing Environments
Section titled “Editing Environments”- Click on an environment
- Update name, description, or sort order
- Save changes
Deleting Environments
Section titled “Deleting Environments”- Click on an environment
- Click Delete
- Confirm deletion
Environment Variables
Section titled “Environment Variables”Solutions can have environment-specific variable values:
| Variable | Development | Staging | Production |
|---|---|---|---|
db_host | dev-db | staging-db | prod-db-cluster |
log_level | debug | info | warn |
replicas | 1 | 2 | 5 |
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:
- Go to Variable Sets and open (or create) a set
- Add a variable to the set
- Pick the environment in the Environment Scope select — that stores the
variable’s
scope_environment_id - Enter the value for that environment and save
- 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.
Best Practices
Section titled “Best Practices”Environment Design
Section titled “Environment Design”Keep environments meaningful and distinct:
| Good | Bad |
|---|---|
| Development, Staging, Production | env1, env2, env3 |
| Integration, Performance, Production | test, test2, final |
Target Distribution
Section titled “Target Distribution”Ensure appropriate target counts:
| Environment | Purpose | Typical Targets |
|---|---|---|
| Development | Quick iteration | 1-2 |
| Test | Integration testing | 2-4 |
| Staging | Production mirror | Same as prod |
| Production | Live systems | As needed |
Sort Order Strategy
Section titled “Sort Order Strategy”Use gaps in sort order for flexibility:
Development: 0Test: 100Staging: 200Production: 300This allows inserting Performance (150) or Pre-Prod (250) later.
Naming Conventions
Section titled “Naming Conventions”Use clear, consistent names:
- Capitalized: Production, Staging, Development
- Or lowercase: production, staging, development
- Avoid abbreviations: prod, stg, dev (unless universal)
Example Environment Setup
Section titled “Example Environment Setup”Standard Pipeline
Section titled “Standard Pipeline”| Environment | Sort Order | Description |
|---|---|---|
| Development | 0 | Developer testing |
| Integration | 10 | Integration tests |
| QA | 20 | QA team testing |
| Staging | 30 | Pre-production |
| Production | 40 | Live systems |
Multi-Region
Section titled “Multi-Region”| Environment | Sort Order | Description |
|---|---|---|
| Development | 0 | Single region dev |
| Staging-US | 10 | US staging |
| Staging-EU | 11 | EU staging |
| Production-US | 20 | US production |
| Production-EU | 21 | EU production |
Next Steps
Section titled “Next Steps”- Creating Environments - Setup guide
- Target Assignment - Managing targets
- Promotions - Promotion workflows
- Environment State - Tracking deployments
