Stage Definitions #
💡 You can replace the default values of the commands for
APPNAMEin the form on the right side! A standard pattern might be
You will use a Stage Definition to describe your stage and apply the definition to take your changes live.
Dump Current Definition #
After creating a stage, you can run
stage:dump to get the current definition of the stage. Often you want to write this to a file to modify the definition and apply it again later on.
setops -p <PROJECT> -s <STAGE> stage:dump > stage.setops.yaml
Definition Schema #
The stage definition is described as YAML and is validated against the Stage Definition JSON schema. If you do not have set up the schema in Visual Studio Code yet, we highly recommend that you do so now.
On the highest level, the stage definition (version
1) has this structure:
schema_version: "1" project: <PROJECT> stage: <STAGE> apps: <APPNAME>: ... services: <SERVICE>: ... log_retention: 14 notifications: <NOTIFICATION>: ...
Let’s have a look at the individual fields:
The version of the schema used. This will be
"1" as long as new changes are backwards compatible, like new fields which are optional.
The name of the project the stage belongs to
The name of the stage
This field is a dictionary/map and uses the app name as a key. To read more about the app configuration, see the dedicated app section.
This field is a dictionary/map and uses the service name as a key. To read more about the service configuration, see the dedicated service section.
log_retention configures the number of days for which logs are kept. This field is optional and defaults to 14 days.
This field is a dictionary/map and uses the notification name as a key. To read more about the notification configuration, see the dedicated notification section.
Apply Definition #
To apply this definition after you performed changes to it, run
setops -p <PROJECT> -s <STAGE> stage:apply -f stage.setops.yaml
+ apps: + ... + notifications: + ... schema_version: "1" project: "<PROJECT>" + services: + ... stage: "<STAGE>" If you want to apply the changes, type 'yes' yes ◢ Initializing… [...] ◤ Planning… [...] ◣ Applying… (17/28) [...] Commit successful!
Now this definition has been applied and your stage should be in the state you defined in the stage definition