Snapshot
A snapshot is an immutable copy of an Environment's state. Snapshots are stored in our State Store. Every snapshot is associated to a single environment, and are assigned a number that will be unique within that given environment.
Snapshots don't contain any of your metadata, but they do contain:
- A copy of the Environment State at the time that the snapshot was taken.
- The head commit hash of your environment's branch at the time that the snapshot was taken.
- The environment's parity hash at the time that the snapshot was taken.
A snapshot can be used as a target for a Rollback, and they help with Branch Switching.
Taking snapshots
Snapshots are automatically taken after a Flow In or a Flow Out. This includes commands that flow in or flow out as part of their process. The full list of commands that will take snapshots are:
- env:create
- env:flowin (except if
--checkOnly
) - env:flowout (except if
--checkOnly
) - env:flowmerge (except if
--gitOnly
)- after source environment flow in (except if
--noSourceIn
) - after target environment flow in (except if
--noTargetIn
) - after target environment flow out (except if
--noTargetOut
)
- after source environment flow in (except if
- stack:create
It is not possible to take a snapshot without an accompanying flow in or flow out.
Managing snapshots
There are commands that allow you to manage snapshots. They all begin with the prefix env:snapshot:
:
- env:snapshot:list - Lists all the snapshots for a given environment.
- env:snapshot:delete - Delete snapshots for a given environment.