Pre-processing your promotion build

Suppose you want to run some checks on the build outputs you are going to promote, for example to ensure they were not compiled with the debug option on. You’ve written a custom REXX script that parses the generated promotionInfo.xml file that contains the name of the build outputs to be promoted and then checks each output. Now what?

Your promotion definition can be configured to run a pre-build and/or post-build command. So, you can just call your REXX from the pre-build command, right? Wrong. The problem is that at the time the pre-build command executes, none of the intermediate files produced on the server to serve as input to the promotion have been transferred to the build machine yet. This means you can’t access promotionInfo.xml to see which outputs to check. Rats!

Rather than use a pre-build command, you will need to use a custom Ant script to perform the promotion. Perform the following steps:

  1. Save the generatedBuild.xml from one of your successful promotion build results to a USS directory on the host where your build agent is running.
  2. Edit the build script and add an additional target that executes your REXX.
  3. Update the “all” target in the build script to execute your target before performing the promote.
  4. In the Promotion definition, on the z/OS Promotion tab, choose “Use an existing build file”.
  5. Specify the build file you created in step 1.

Note that the dependency build offers more flexibility in this area than promotion, in that you can specify a pre or post build script to be executed right before or right after the main build script. This gives you the ability to inject additional Ant tasks while still generating the build script on each run. This capability was added in version 4.0 and can be found on the z/OS Dependency Build tab of your build definition.

This entry was posted in Enterprise Extensions, Rational Team Concert, System z. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s