Old dog, new trick: RTC and UrbanCode Deploy

Calling Rational Team Concert an old dog isn’t fair  – it’s only just over 5 years old –  and I mean it in the nicest possible way in the context of the Jazz Jumpstart team being “old”, and the Rational Emerging Technologies Team, well, “emerging”.

Anywho, as is my wont, I was going through what could be in the next CLM release, noticed the bit about Rational Team Concert Build and IBM UrbanCode Deploy and decided to try out this “emerging” feature with Rational Team Concert 4.0.5 RC1.

On the UrbanCode Deploy front I do the following:

1. Create an empty Component JKEComponent with the Source Config Type set to none.

jkecomponent

2.  create a Deployment process deployJKEComponent for the JKEComponent that has one  Download Artifacts step (with default settings). 

compprocess

3. Create an Application JKE and add JKEComponent  to it.

jkeapplication

4. Create a process deployJKEApp for the JKE Application that has one Install Component step in it which invokes the deployJKEComponent component process.

deployjkeapp

5. Create an environment for the JKE Application called DEV.

6. Add a Base Resource  to the DEV environment and add JKEComponent  as a Component Resource to one of the agent resources

devagentcomp

That’s it for the UCD setup.

On the RTC front I use the build infrastructure that is created as part of the Money that Matters CLM sample (see  Configuring the Money that Matters sample environment), in particular the brm.continuous build definition.  Using the RTC Eclipse client I edit the configuration of the  brm.continuous build definition and add the  post-build Deploy option.

postbuildoption

 The build definition now has a “Post-build Deploy” tab which has 3 configuration sections:

1. Server Information Section

serverinfo

This section collects information on how RTC should connect to the UrbanCode Deploy Server. Note that the instructions in topicCreating encrypted password files can be used to create a password file.

2. Publish Artifacts Section

publishartifacts

This section is used to specify how the results of the build are to be published to a UCD component:

Component: I specify the JKEComponent I created in UCD.

Version: I want the name of the component version to be the same as the build label which is in the ${buildLabel} build property.

Base directory:  This is set to the Jazz Source Control load directory relative to the Jazz Build Engine’s current directory and is constructed from a property specified by the Build Definition (${outputRootDirectory}) and the build label.

Include files: I only want a couple of files from the build in the component so I specify those here.

Links: I want to be able to navigate from the component  version back to the RTC Build result so I add a URL here.

3. Process Section

This section specifies the Application process to run and the Environment to deploy into.

processsectionThat covers the setup required. After firing up a build engine , I can request a build and after compiling, running tests etc. the post-build deploy option is invoked. The full build log shows this invocation:

buildlogThe External Links tab of the RTC Build Result also has a link to the UCD component version created.

compverlink

Following the link shows the details of the Component version with the same name as the RTC build result, the files as specified and a link back to the RTC Build Result.

compverdetails

Checking the DEV environment shows that the build has been successfully deployed.

appdeployed

So this proves to be an easy way to integrate RTC’s build mechanism with UCD. A couple of points to note:

  • If the Deploy check-box in the Process section of the RTC build definition is not  enabled then the files specified will still be published to the UCD component but the Application process will not be invoked.
  • Unlike the post-build Deliver option , there doesn’t seem to be a way to stop the invocation of the post-build deploy if the build fails for some reason. I haven’t dug deeper but maybe the application process should check a “build status” property before executing.

A final point to note:  I carried this out with RTC 4.0.5 RC1 so it is quite possible some/all of this may change by  4.0.5 GA.

About these ads

11 thoughts on “Old dog, new trick: RTC and UrbanCode Deploy

  1. Excellent article!
    I have followed the steps using UCD 6.0 and CLM 4.0.5 RC1 and got the post-deploy to work. I have now upgraded to UCD 6.0.1, and now the deploy fails when it tries to publish the version files to UCD. Here is what I see in the build log:

    java.lang.RuntimeException: java.lang.Exception: Request error: 500: No content was specified for hash SHA-256{fd53d8a43c9b17c9118bcf4a487d3893742692c1b1a9f2fb38433218c88cd306} (for file build/jke-C20131203-1148.zip
    java.lang.Exception: Request error: 400: No such transaction

    Any idea what’s caused this in UCD 6.0.1, and how to resolve it?

    1. Hi Sudheer
      I’m getting the same problem after upgrading. I’m going to try it with the RTC 405 GA version and if it still fails will raise a defect.

  2. Hi Freddy,
    I managed to get it working with RTC 4.0.5 GA and UCD 6.0.1.2. I have one issue though, if the Application deployment process fails it doesn’t affect the build result. Is this working as designed ?

  3. I am using rtc4.0.5 with ucd 6.0.1.3.

    i am getting error while deploying the application.

    ManagerURL : http://manoj1:8080/manager/text
    ManagerUsername : ****
    Tomcat context : /jke
    War File : jke.war
    Context XML:
    Caught: java.lang.Exception: War file does not exist!
    java.lang.Exception: War file does not exist!
    at deploy.run(deploy.groovy:43)

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s