How To

How to use the IBM UrbanCode Release plug-in part 3: Add Snapshot Status step

Print

The IBM UrbanCode Release plug-in for IBM UrbanCode Deploy provides tools that integrate the two products more efficiently. Once installed, you can use the four plug-in steps in your IBM UrbanCode Deploy process design workflows:

Step 1: Add Comment to Task
Add comments in IBM UrbanCode Deploy to  automated tasks started by IBM UrbanCode Release scheduled deployments.

Step 2: Update Application
Update the IBM UrbanCode Release inventory for applications deployed by IBM UrbanCode Deploy.

Step 3: Add Snapshot Status

  • Add a version statuses to snapshots during deployment processes.
  • Add comments and attachments to statuses.

Step 4: Get Release for Environment
Get the name of a release that is active for a specific environment, to facilitate auto progression for releases.

This article covers the Add Snapshot Status step.  The other steps are described in the following articles:

Part 1:  Add Comment to Task step

Part 2: Update Application step

Plugin prerequisites:
Download the IBM UrbanCode Release plug-in from the IBM UrbanCode Deploy Plugin page, and then import the ucr_plugin-version.zip file (Home > Settings > Plugins  > Load Plugin).

Optional:
Define  authentication properties required by the plug-in as system properties. System properties are accessible from anywhere, and, when changed, are automatically updated across all process steps that use them.

Step: Add Snapshot Status

Use the Add Snapshot Status step to apply a status or stamp to an application version  during an IBM UrbanCode Deploy application process. For example, a deployment process might perform a quality test on an application version and add a status based on test results, along with comments and attachments.   The inventories of both IBM UrbanCode Release  and IBM UrbanCode Deploy can be automatically updated.

Of course, you can manually add statuses, comments, and attachments to application versions in IBM UrbanCode Release. The Add Snapshot Status step enables you to automate those manual steps with a  single deployment process.

Example
In this example, as part of an application named Install Notification Manager, an automated Selenium test is run on a snapshot version.  The application process is triggered by a scheduled deployment in IBM UrbanCode Release. When the test runs, the results are posted to an external web page. Using the Add Snapshot Status step, a status is applied to the snapshot based on the test results. In this instance, the Add Snapshot Status step also provides the external URL as a comment and attaches a file that contains additional test details.

The version statuses previously created in IBM UrbanCode Release are:

SELENIUM TEST PASSED
SELENIUM TEST FAILED

The following figure shows the IBM UrbanCode workflow, and the statuses defined in IBM UrbanCode Release:


release-plugin-add-status-snapshot-from-workflow
The Add Snapshot Status step requires the ID of the target snapshot.  This value is found in the snapshot.id property.  The snapshot.id property is only accessible at the application process scope. An easy way to make it available at the component process scope, which is what we need, is to create a component process property, as we did in Part 1 of this series.  In this example, the component property is named snapshotid and is assigned a value of ${p:snapshot.id}. The property snapshotid  will contain the ID of the snapshot selected by the user when the application runs.


release-plugin-add-status-snapshot-from-property
Here are the fields for the Add Snapshot Status Passed step using the snapshotid property:

URL contains the location of IBM UrbanCode Release server.
User and Password provide user credentials for authentication.

Status Name contains the name of an existing version status in IBM UrbanCode Release. This branching step is only taken if the test passed, so the value is SELENIUM TEST PASSED.  The status is case sensitive and the step fails if the status does not exist in IBM UrbanCode Release.  The other branching step, Add Snapshot Status Failed, contains the value SELENIUM TEST FAILED in this field.

Comment contains the external URL with the test results.
Attachment Path contains the full path to the file attached to the status. The file must be accessible by the agent executing the deployment process. If the file is not found, the step fails.

Snapshot ID contains the reference to the component process property created earlier: ${p:snapshotid}.


release-plugin-add-status-snapshot-step

When you run the process in IBM UrbanCode Deploy, the Install Notification Manager/snapshot field automatically contains the property reference defined earlier, as shown in the following figure:


release-plugin-add-status-snapshot-run-process

If the selected snapshot does not exist in IBM UrbanCode Release, the process fails. You can ensure that the snapshot exists by performing an integration before running the application. Because that is not always practicable, a better way is to add the Update Application step to the workflow, as demonstrated in Part 1 of this series, By using the Update Application step, you ensure that the snapshot exists in the IBM UrbanCode Release inventory before it is referenced.

In this example, the application version passed the Selenium test and the SELENIUM TEST PASSED status is added to the snapshot, as shown in the following figure from IBM UrbanCode Deploy:


release-plugin-add-status-snapshot-logs
 This figure shows the status applied to the Install Notification Manager application version in IBM UrbanCode Release:


release-plugin-add-status-snapshot-result

Finally, this figure shows that the comment and the attachment have been added to the status:


release-plugin-add-status-snapshot-status-detail