IBM Support

How to integrate UrbanCode Deploy with Jenkins Continuous Integration

Technote (FAQ)


Question

How do you integrate IBM UrbanCode Deploy with Jenkins CI (Continuous Integration)?

Cause

After running a build in your existing Jenkins CI infrastructure, you want to deploy your applications automatically to various environments using IBM UrbanCode Deploy.

Answer

UrbanCode Deploy offers a plug-in for Jenkins CI which enables you to publish the build result to UrbanCode Deploy and trigger an application process.

Note: This scenario covers only the Jenkins CI server and not the Hudson CI server.

Table of Contents:




Prerequisites:

  • Jenkins server installed. For this example, it runs on http://jenkins-server:8080/
  • UrbanCode Deploy server. For this example, it runs on https://udeploy-server:8444/
  • An application called MyApp, in an environment called SIT (System Integration Test), a component called MyComponent associated with MyApp and an Application Process called Install.

You do not need to have a Jenkins Job configured, a Jenkins Workspace configured, or the Jenkins UrbanCode Deploy plug-in installed, as these will be created in the following steps.



Installation:

Install the Jenkins plug-in shipped with UrbanCode Deploy. You can get the file ibm-ucdeploy-publisher.hpi from one of these sources:

Option 1:
IBM UrbanCode Deploy 6.0.1 download from Passport Avantage. Unpack the UBCD_PLUG-INS_6.0.1_MP_EN.zip file

Option 2:
Jenkins Plugin and click Download

  1. Open the website of your Jenkins server

  2. Click on Manage Jenkins

  3. Click on Manage Plugins

  4. Open the Advanced tab


  5. Click on Browse In the section Upload Plugin

  6. Select ibm-ucdeploy-publisher.hpi. Click Upload



  7. Restart your Jenkins server in order to see the new plug-in by using http://jenkins-server:8080/safeRestart

  8. Verify that the plug-in is installed and enabled




Configuration:

  1. Click on the link Manage Jenkins

  2. Click on Configure System

  3. Add a profile for your UrbanCode Deploy server

    For example, where
    • Profile Name is udeploy-server
    • IBM UrbanCode Deploy URL is https://udeploy-server:8444/
    • User name is admin
    • Password is admin user password

  4. Click Test connection to verify the configuration and click Apply



  5. Configure the post-build actions for each job.

    1. Use a free-form Jenkins job called MyJob with default settings

    2. Pick the option Execute shell in the section Build

    3. Specify a simple zip command, such as: zip ${WORKSPACE}/data.zip /uc/jenkins/source

      Note:
      WORKSPACE refers here to the Jenkins workspace location




    4. Select the task Publish artifacts to IBM UrbanCode Deploy in the section Post-build Actions

    5. Select the following options:



    6. Click Save




    7. Click on the button Build Now


RESULT: Resources are built in Jenkins.
A new component version is created for component MyComponent in UrbanCode Deploy.
The Jenkins UrbanCode Deploy plug-in triggers the application process Install in application MyApp on UrbanCode Deploy.



Known Problems:

The Jenkins UrbanCode Deploy plug-in requires at least version 1.2.12 of Log4J, but Jenkins ships version 1.2.9. This results in the exception below:


ERROR: Failed to upload files
java.lang.Exception: Failed to upload files
at com.urbancode.ds.jenkins.plugins.urbandeploypublisher.PublishArtifactsCallable.call(PublishArtifactsCallable.java:144)
at com.urbancode.ds.jenkins.plugins.urbandeploypublisher.PublishArtifactsCallable.call(PublishArtifactsCallable.java:22)
at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
...
Caused by: java.lang.NoSuchMethodError: org.apache.log4j.Logger.isTraceEnabled()Z
at com.urbancode.commons.fileutils.filelister.FileListerBase.list(FileListerBase.java:133)
at com.urbancode.commons.fileutils.filelister.FileListerBase.list(FileListerBase.java:80)
at com.urbancode.vfs.common.ClientPathEntry.createPathEntriesFromFileSystemWithPrefix(ClientPathEntry.java:132)
...

WORKAROUND:

  1. Open jenkins.warand navigate to META-INF

  2. Delete JENKINS.SF and JENKINS.RSA

  3. Open MANIFEST.MF and delete all of the lines that start with SHA1-Digest

  4. Place the new Log4j with version greater or equal to 1.2.12 (e.g. Log4J 1.2.17) jar in WEB-INF/lib

  5. Update MANIFEST.MF to point to the new version




Additional troubleshooting:

In case of other problems, perform these steps:

  1. Get the Jenkins log file

  2. Get the list of Plug-ins from Jenkins

  3. Review the Build log file

  4. Verify that a Request Application Process got triggered for the Application MyApp

  5. Check if the Application Process ran successfully

  6. Check the UrbanCode Deploy log: deployserver.out

  7. Provide all the above logs to IBM Client Support, if the issue persists

Document information

More support for: IBM UrbanCode Deploy
Integrations - IBM

Software version: 6.0, 6.0.1

Operating system(s): AIX, Linux, Solaris, Windows

Reference #: 1664334

Modified date: 26 January 2017