Creating a new Package Type and Defining Package States
Before creating a new Application, a new Package Type and Package States must be defined in the Custom Types section.
Watch the video:
Note: See Working with Packages for more information about Packages and Stateflows.
This page includes the following:
Package Overview
Stateflow Transitions
You can manually transition the Package depending on the approach you want to take:
- If you want to free up/tear down a set of targets immediately after each successful deployment, you can further move the Package to the "Stable" state right after the Package reaches the "Live" state.
- If you want to keep the old set of targets, do not transition it to “stable” until the next release is ready.
- If you do not want to promote the new Package to “live” or if you switched the Package back to a previous state, you can transition this Package to the “reject” state to free up targets for the next release.
To Create a New Package Type
- Navigate to Settings > Custom Types.
- Hover over the Package tab and click the add button displayed. The Create Custom Type dialog is shown.
- Select the Create from Existing radio button (for this scenario, the new type will be based on the Deployment Package Type)
- Name the new Custom Type BlueGreen.
- Enter the version number: 1.0
- Select the Package Type.
- Select the Deployment Custom Type.
- Select the version you want to base the new Custom Type on.
- Click Create.
To Create the Package States
- Open the BlueGreen Package Type.
- Display the Workflow section.
- Right-click the States section and go to Add child > State
- Add the following States:
State description
- Active: initial Package state upon creation.
- Deploy: transitional state. Used to trigger the "Trigger_Deployment" & "Deploy" Workflows.
- Deployed: Package deployed into Target. Traffic has not been routed yet.
- Switch: transitional state. Used to trigger the "Switch" Workflow.
- Live: traffic is being routed to the new Target.
- Switch_Back: transitional state. Routes the traffic to a previous installation. Used to trigger the "Switch_Back" Workflow.
- Mark_Stable: transitional state. Used to trigger the "Mark_stable" Workflow.
- Stable: this is the new stable version of the Application deployed. Traffic is currently being routed to the green Targets. A new version of the Application must be installed on the blue Targets.
- Retire*: transitional state. Used to retire the current application version and free up the green Targets for a new application version. This state triggers the "Trigger_Undeploy" > "Undeploy_Environment" Workflows.
- Retired*: Package retired from production. The Target is free for a new installation.
- Reject*: transitional state. The Package is deemed unfit for production. Used to trigger the "Trigger_Undeploy" > "Undeploy_Environment" Workflows.
- Rejected*: final state for rejected Package versions. The Target is free for new installations.
Note: (*) These are optional "good housekeeping" states that clean up the Target used.
-
Now define the ClosingState condition and transitions for each State:
State isClosingState Transition Transition name toState Active true Deploy Deploy Deploy Deploy false Deployed Deployed Deployed Deployed false Switch Switch Switch Reject Reject Reject Switch false Live Live Live Live false Mark_Stable Mark_Stable Mark_Stable Switch_Back Switch_Back Switch_Back Switch_Back false Deployed Deployed Deployed Mark_Stable false Stable Stable Stable Stable false Retire Retire Retire Retire false Retired Retired Retired Retired true - - - Reject false Rejected Rejected Rejected Rejected true - - - -
Finally, define the following dynamic properties:
- Right-click the Properties section and select Add after > Dynamic Properties.
- Right-click the newly created Dynamic Properties section and select Add child > Property.
- Hover over the /NewProperty default value (first value displayed on the right column) and click to edit it. Enter the following values:
- Name: /general/deployment/Environment
- Protected: false
- Highlighted: false
- Type: SingleLineText
- allowCustomValues: false
Next steps: