Automating RTC Source Promotions from Urbancode Deploy
In a recent project for a z/OS customer, we had to create some custom scripts to kick off a Rational Team Concert Promotion definition. This is a special type of build definition found in the RTC Enterprise Extensions, and is used for promoting change sets from one stream to another, by their attachments to work items. Typically, a developer would develop new code or fix a defect, and attach those change sets to a work item in RTC. With the Enterprise Extensions, you can “Promote a work item”, which means that the changes linked to that work item get promoted from one stream to another.
While we managed to do this with some custom groovy scripts, we decided this would be an apt time to turn it into a true plugin for Urbancode Deploy.
To use it, install the plugin using the normal method for installing automation plugins. Once installed, you should now see a new step in your process editor drawer under Utilities > Rational Team Concert.
Drag and drop the process onto your process editor. In the example below, we have a switch step that checks to see if the given environment requires a promotion (it checks for the value of the PromoteCode variable). If the variable is “true”, it kicks off the ‘Execute Source Promotion Definitition’.
Next, edit the properties on the step. Each field has a mouse hover helper to help you understand what to fill in. So, for example, if we had a Team Concert server, and the URL to that server was https://rtc.demo.com/ccm, and had a promotion definition of uat.prod.promotion that we wanted to kick off, we would fill out the properties as below.
Note that this can issue a “Promote Preview”, which will tell if you if you have any errors before actually kicking off the promotion. We recommend you use this as part of your process first. For example, this could come at the very beginning of the process for the promote preview, and then issue the real preview once all the datasets have been deployed and other process steps completed (i.e. DB2 binds, CICS new copies, etc). The promote preview will check for the following:
- Ensures that the work items are in the correct/required states prior to promotion
- Checks to see if there are any gaps in the change sets (which means you may have to promote additional work items to complete the promotion)
- Looks to see if the change sets are in the target stream
Any warning or validation errors are written into the process step log so, if the step fails, you can find the error message as you would with any other plugin.