Ephemeral Environments
Ephemeral environments provide temporary, lock-based deployment targets for ad-hoc testing and CI agent integrations.
Session Lifecycle
- Claim -- A lock is acquired on the environment (via PR event or API call)
- Deploy -- Commits are deployed to the environment using the pipeline's steps
- Release -- The lock is released (PR closed, API call, or timeout)
- Reset -- If
on_release: deploy_mainis configured, the latest main branch commit is deployed
PR Workflow
When a PR is opened targeting a branch matching an ephemeral environment's target_branches:
- DevRamps automatically claims the environment
- The PR's head commit is deployed
- PR comments show deployment status
- When the PR is closed, the environment is released
If the environment is already claimed, a contention comment is posted on the PR with a link to force-claim.
API Workflow
For environments with api triggers:
- Claim a session:
POST .../ephemeral-environments/{name}/sessions - Deploy commits:
POST .../sessions/{sessionId}/deploy - Check status:
GET .../sessions/{sessionId} - Release:
DELETE .../sessions/{sessionId}
Notifications
Subscribe to ephemeral events in your pipeline's notification config:
ephemeral_claimed-- Environment lock acquiredephemeral_released-- Environment lock releasedephemeral_deployment_succeeded-- Deployment completed successfullyephemeral_deployment_failed-- Deployment failed
Force Claiming
If an environment is locked and you need access, you can force-claim it. This releases the existing lock and creates a new one. The previous lock holder receives a notification.