Blogs about Jazz

Blogs > Jazz Team Blog >

Continuous Deployment on Jazz Staging

On September 26, the Jazz team reached another milestone in our quest to continuous deployment of IBM Collaborative Lifecycle Management (CLM) to production on Jazz.net.

The team managed a complete move from continuous integration to end-to-end continuous deployment. This included building, testing and deploying a CLM build, without human intervention. With such a milestone, the CLM team can fulfill the promises of the DevOps paradigm, which is to release faster and reduce risk. The automated deployment and testing now takes 25 minutes instead of 1 hour manually. And, because the team now deploys daily, this means saving 15 days of work!

Result of IBM UrbanCode automated deploy

Result of IBM UrbanCode automated deploy

Here’s how the end-to-end system works:

  1. A developer checks in code in Rational Team Concert in the Integration Stream.
  2. The code is built.
  3. A new version of the CLM component is pushed to IBM UrbanCode Deploy.
  4. The build is installed on a test system.
  5. Tests are run against the test system.
  6. Status of the test is set in IBM UrbanCode Deploy on the version.
  7. The same build script upgrades staging through IBM UrbanCode Deploy.

And, here’s how we set up the IBM UrbanCode Deploy Server to achieve full automated deployment. Note: The ANT scripts below are given as partial examples and will not work as-is in any environment.

After the Build is done, we push the version, the clmBuildLabel, to IBM UrbanCode Deploy Server using the following ANT target.

<target name="udclient">
<!-- Create a new version for the Jazz self-host application -->
<property name="UCDVersionName" value="${clmBuildLabel}"/>
<property name="UCDComponentName" value="clm"/>
<java jar="${UDClientJar}" fork="true" outputproperty="cmdOutput" resultproperty="udcCmdResult">
<arg value="-weburl"/>
<arg value="${UCDServer.weburl}"/>
<arg value="-authtoken"/>
<arg value="${UCDServer.authToken}"/>
<arg value="createVersion"/>
<arg value="-component"/>
<arg value="${UCDComponentName}"/>
<arg value="-name"/>
<arg value="${UCDVersionName}"/>
</java>
<!-- Only want to proceed if the createVersion was successful -->
<echo message="Output from createVersion is ${cmdOutput}"/>
<echo message="udclient command result is ${udcCmdResult}"/>
<condition property="validToPublishToUCD">
<equals arg1="${udcCmdResult}" arg2="0"/>
</condition>
<echo message="Valid to publish to UCD: ${validToPublishToUCD}"/>
</target>

After the Test pass, we set up the status value of the test to the version using the following ANT target.

<target name="setUCDStatus" if="UCDStatusValue">
<echo message="Setting UCD status to ${UCDStatusValue} for ${UCDComponentName} version ${UCDVersionName} based on component ${component} result."/>
<java jar="${UDClientJar}" fork="true">
<arg value="-weburl"/>
<arg value="${UCDServer.weburl}"/>
<arg value="-authtoken"/>
<arg value="${UCDServer.authToken}"/>
<arg value="addVersionStatus"/>
<arg value="-component"/>
<arg value="${UCDComponentName}"/>
<arg value="-version"/>
<arg value="${UCDVersionName}"/>
<arg value="-status"/>
<arg value="${UCDStatusValue}"/>
</java>
</target>

Finally, we removed any gate on the IBM UrbanCode Deploy Server, and used the following code to push for the deployment of the version. This target calls the REST API of IBM UrbanCode Deploy.

<target name="upgradeStaging" depends="checkProperties">
<tempfile property="temp.file" suffix=".json" destdir="${java.io.tmpdir}" />
<echo file="${temp.file}">
{"application": "clm-jazz",             #the UCD application
"applicationProcess": "upgrade",    #the Process for the application
"environment": "bluesdev",           #the staging system
"versions": [
{    "version": "${clmBuildLabel}",
"component": "clm"},],}
</echo>
<requestApplicationProcess
jsonFile="${temp.file}"
debug="true"
authFile="${udAuthFile}"
requestIdPropertyName="requestId"
requestUrlPropertyName="requestUrl"
/>
</target>

Here are the links for the Command Line API and the REST API for the server:

In the next steps, we will run the set of tests against the staging environment, and then we will plan continuous delivery and deployment to the production system. Once the entire pipeline works perfectly on staging, the team will plan continuous delivery and deployment to the production system.

Thank you!

Christophe Elek
Bluemix Fabric team in IBM ensuring continuous deployment of all the systems