Environment Lifecycle
This page shows the status of an environment, what each action removes, and when an environment expires.
Life of an Environment
An environment goes through these stages. You start each stage, except the automatic end of the lifetime.
| Stage | Who starts it | Status after | What happens |
|---|---|---|---|
1. Create |
You: Create-Environment |
|
Jenkins writes the configuration on the Jenkins controller. The lifetime starts now. No containers run, and the agent has no files. |
2. Deploy |
You: Deploy-Environment |
|
Jenkins copies the configuration to the agent and starts the containers. If the deploy fails in Deploy Services or later, the status is |
3. Test |
You |
|
You use the access addresses from the build log. |
4. Change |
You: Update-Environment, then Deploy-Environment |
Same status after Update, |
Update changes the configuration only. Deploy applies the change to the containers. |
5. Pause |
You: Manage-Environment with Stop, later Start |
|
Stop removes the containers and keeps the data. Start creates the containers again. |
6. End |
You: Manage-Environment with Delete. Or automatic: the lifetime ends. |
No status. The environment no longer exists. |
Jenkins removes the containers, data and configuration. See What Stays and What You Lose. |
A failed environment can go back to stage 2.
A stopped environment can go to stage 4, and each environment can reach stage 6 from any status.
States
Each environment has one status. An arrow shows a job that you start, or an automatic event where the label says so.
| Status | Meaning |
|---|---|
|
The configuration exists. No containers run yet. |
|
A deploy is running now. |
|
The last deploy or start succeeded. |
|
You stopped the environment. The containers do not exist. The data stays. |
|
The last deploy failed in Deploy Services or later. See What Stays and What You Lose. |
|
Jenkins cannot read the |
What Stays and What You Lose
A failed first deploy clears the database data of the environment. An administrator can keep this data with QA_KEEP_FAILED_STATE=true.
|
| Action | What stays | What you lose |
|---|---|---|
Deploy-Environment on an existing environment |
Your other files on the agent, the data and the logs. Jenkins adds only missing files. |
Your edits to |
Deploy-Environment with Reset Configs |
The data, the logs, |
Your edits to each file with a Jenkins copy. |
Deploy-Environment fails before Deploy Services |
Everything. Running containers keep running. |
Nothing. |
Deploy-Environment fails in Deploy Services or later, and the environment may hold data from an earlier deploy or start |
The database data, the logs and the configuration. |
The containers. |
Deploy-Environment fails in Deploy Services or later, and the environment was never deployed or started |
The logs and the configuration. |
The containers and the database data: |
Update-Environment |
The running containers and the files on the agent. Run Deploy-Environment to apply the change. |
Nothing on the agent. |
Manage-Environment: Stop |
Volumes, data, logs and configuration. |
The containers and files outside the mounted folders. |
Manage-Environment: Delete |
Only the optional backup. The backup contains the configuration from the Jenkins controller, not database data. |
The containers, volumes, networks, data, logs and configuration. |
The lifetime ends |
Nothing. Jenkins makes no backup. |
The containers, volumes, networks, data, logs and configuration. |
The files of an environment are in /opt/qa-envs/<env>/ on the agent.
Lifetime
Cleanup-Environments runs every day at about 02:00 on the Jenkins clock. You do not need to start this job.
The lifetime counts from the creation date, also after you change Time To Live.
You can also run Cleanup-Environments yourself. A manual run affects only your own environments, unless you are an administrator.
For Developers
meta.json schema
Each env owns a meta.json under /var/jenkins_home/qa-data/envs/<env>/. Typical content:
{
"env_name": "andromeda-1745",
"database_type": "mysql",
"services": ["mysql", "hazelcast", "ftacs", "ui-backend"],
"image_versions": { "ftacs": "5.12.3", "ui-backend": "5.12.3" },
"release_base": "v7-1-3",
"qa_issues": ["DEV-1234", "DEV-1235"],
"runner": "qa-runner-04",
"status": "deployed",
"ttl": "1w",
"created_at": "2026-04-22T09:14:51Z",
"created_by": "alice",
"owners": ["bob", "carol"],
"last_action": "deploy",
"last_action_at": "2026-04-22T09:17:02Z"
}
| Field | Notes |
|---|---|
|
Must match |
|
|
|
Sorted list of enabled services. Must be a subset of the keys in |
|
Per-service tag map; omitted entries fall back to the template default ( |
|
The release the versions came from. Update-Environment removes it when a version no longer matches this release. |
|
The tickets the form applied at creation. |
|
Last agent the env was deployed on. Updated by |
|
One of |
|
One of |
|
Set once by |
|
Mutable list of Jenkins logins granted the same RBAC rights as the creator (except they can also be removed). See RBAC & Ownership. |
|
Written on every successful action for auditability. |
All writes to meta.json go through utils.atomicWriteMeta(path, data) — temp file + rename — to avoid torn reads if a second job reads the file mid-write.
Who drives which transition
| Job / step | Transition | Notes |
|---|---|---|
|
|
Renders compose + |
|
configured → deployed, stopped → deployed |
Runs port-conflict check, |
|
stays in current state |
Re-renders compose with new services / tags / vars. Starts no containers. Strips Compose |
|
configured, stopped or failed → deployed |
|
|
|
|
|
any → deleted |
|
|
no state change |
Rewrites |
|
expired → deleted |
Cron |