16. Lifecycle
Let's turn our attention from building solutions to managing their lifecycle. Flowgear's lifecycle features help you manage change and apply appropriate governance principles. This is especially important for solutions that would cause business disruption if they were to fail.
- Environments provide an easy way to target test endpoints (e.g. database or service instance) while building and testing.
- Revision Management tracks changes to a Workflow so that you have a full history of changes.
- Release Management controls when a revision of a Workflow ships to a specific Environment (for example, UAT or Production).
We'll discuss each of these in more detail here.
Environments
Environments provide a logical container that stores Workflow definitions along with Connection information.
By controlling when a Workflow is published to an Environment, you are able to build and test independent of the version of the Workflow that is already in Production.
By using different credentials under the Environments within a Connection, you can ensure that your testing doesn't interact with Production services or endpoints.
By default, each Site has two Environments, Test
and Production
. Open → Edit Site Settings
to see the list of Environments.
Click ✎
next to an Environment to see its properties:
Name
provides a descriptive NameVersion Control Branch Name
provides the name of the version control branch that will be mapped to the Environment. This only applies when Flowgear is configured to store Workflows in a version control system like GitHubHostname
is the endpoint that will be used to invoke Workflows in that Environment. Each Environment can have a unique hostname and you are able to customize the hostname of the Production Environment.Allowed Origins
controls CORS behavior. For more information see Site Detail Pane and http://www.w3.org/TR/cors/.Key
is a unique identifier for the Environment
On the Workflow Design pane, the run button defaults to Test
(or the name of your first Environment). You can switch between different Environments using the v
dropdown to the right of the Environment name shown on the run button.
Revision Management
Each time a Workflow is saved in the Design pane, a new revision of the Workflow is stored. You can review prior versions of a Workflow by clicking the Revision History
button.
When clicked, a list of revisions will be displayed. Clicking one of these versions will open it in a new browser tab. You can copy sections of a Workflow if you wish to bring parts of an old design back in to a Workflow or you can click Save to save that version as the latest again. At this point it becomes the new latest revision of the Workflow.
Configuring Release Management & Version Control
Flowgear provides the option of storing Workflow designs within its internal storage or using a third party version control system like GitHub.
You can access Release Management & Version Control
from → Edit Site Settings
.
Under Version Control Mode
, select either Basic
or GitHub
.
- Under
Basic
, Flowgear will store your Workflow revisions in its internal storage. - Under
GitHub
, Flowgear will store Workflows in your GitHub account. Provide the URL to your repository inRepository URL
and follow the steps at Setting up a Version Control Token to configure your user account to interact with your GitHub account. Other users who require Workflow access will need to follow the same steps.
Flowgear also allows you to control which Environments a Workflow is pushed to when it is saved. If you set Release Management Mode
to Disabled
, a Workflow will be saved to all Environments when you save it.
If you set Release Management Mode
to Enabled
, a Workflow will only be saved to the first Environment and you will need to promote it to other Environments explicitly. This allows you to work on a new design for a Workflow without disrupting the version of that Workflow that is already in Production.
Using Release Management
When you have Release Management enabled, saving a Workflow will only publish it to the first (i.e. Test) Environment.
When you are ready to publish the Workflow to other Environments, click Promote Workflow
from the Workflow Design pane.
In the pane that opens, you'll see a list of Environments and a Promote
button between each of them. Clicking Promote
will publish the Workflow from the Environment on the left to the Environment on the right.
Exercise 23: Release Management
Set Release Management
to Enabled
under Release Management & Version Control
(accessed from → Edit Site Settings
).
Add
Formatter
to a new Workflow and connectStart.RunNow → Formatter
.Set
Formatter.Expression
tohello world
.Add
Variable Bar
.Add
Variable Bar.Greeting
.Connect
Formatter.Result → Variable Bar.Greeting
.Open the Workflow Settings pane and turn on
Allow Run On Demand
.Save the Workflow.
Run the Workflow and confirm you're seeing the result
hello world
.Click
Promote Workflow
then clickPromote
to promote the Workflow version from theTest
Environment into theProduction
Environment.Change
Formatter.Expression
tohello universe
.Save the Workflow.
Click
Promote Workflow
again and confirm that you are seeing a different Workflow revision under theTest
Environment to the one under theProduction
Environment.Go back to the Workflow Landing pane by clicking
<
, then clickRun Workflow
.Run the Workflow and confirm you're seeing the result
hello world
- this is the version of the Workflow that is currently in theProduction
Environment.Click
...
next to where the Environment is shown and selectTest
.Run the Workflow again and this time you should see
hello universe
.
Return to the Workflow Design pane and click Submit Exercise
to grade the Workflow.