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 promotion pipeline |
| Targets | Assigned target machines |
Sort Order
Section titled “Sort Order”The sort order determines environment progression:
| 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
- 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.
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. Targets with higher priority values deploy first:
| Target | Priority | Deployment Order |
|---|---|---|
| web-1 | 80 | First |
| web-2 | 70 | Second |
| web-3 | 60 | Third |
| db-1 | 10 | Last |
This is useful for:
- Deploying web servers before database
- Rolling out to canary servers first
- Ensuring dependency order
Assigning Targets
Section titled “Assigning Targets”- Navigate to Environments in the sidebar
- Select an environment
- Go to the Targets tab
- Click Add Target
- Select target(s) from the dropdown
- Set priority values
- Save
Removing Targets
Section titled “Removing Targets”- Open the environment detail page
- Find the target in the list
- Click Remove
- 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 | Can skip to later environments |
Creating Environments
Section titled “Creating Environments”In the UI
Section titled “In the UI”- Navigate to Environments in the sidebar
- 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 |
Configure variables:
- Navigate to the solution detail page
- Go to Variables tab
- Select environment scope
- Enter environment-specific values
- Save
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
