Guide to Integrating Rational Build Forge with IBM UrbanCode uDeploy
As a development team, there are times when we need to automate the build and deployment of application code and the related deployable elements. In this scenario, Build Forge and uDeploy can help you to do the automation work:
This article provides a step-by-step example of how to set up a continuous delivery environment with Rational Build Forge and UrbanCode uDeploy.
Build Forge provides 2 adapters to make it simple to integrate with uDeploy, and they can be used separatly for different purpose:
- uDeployPublisher Adapter: used to pubish the builded artifacts to uDeploy Code Station for deploy.
- uDeployDownloader Adapter: used to download needed artifacts from uDeploy Code Station.
Prerequisites
To follow this article, you must have installed Build Forge and uDeploy.
For installation instructions, see the Build Forge and uDeploy information center links in the Reference section.
Part I, Publish Artifacts
Overview
As shown in the above picture, the scenario of the integration is very clear, Build Forge will do the build work, then publish the build artifacts to the uDeploy for deployment.
The design of the integration is simple, as uDeploy has provided the uDeploy Client for the third parties to do the integration with uDeploy. Build Forge will leverage this component. The whole integration process will be:
- Build Forge provides an uDeploy XML adapter to send uDeploy commands to uDeploy Client to do the publish work.
- After promotion to automated deployment tool is finished, Build Forge fetches the log and adds the published artifacts to Build Forge BOM.
User can change the environment variables in Build Forge to use the XML Adaptor.
Environment variable | Intro |
UCLIENT_PATH | The uClient install path in the os, will be the [BF install path]/jas_utilities/jars |
UDEPLOY_SITE_URL | The uDeploy url |
UDEPLOY_SITE_USERNAME | The uDeploy username |
UDEPLOY_SITE_PASSWORD | The uDeploy password |
BUILD_COMPONENT | The component name |
BUILD_VERSION | The component build version name |
BUILD_PATH | The component build path |
Usage Example
uDeploy Side
- Login to uDeploy and create a component named helloworld.
Build Forge Side
- Make sure you have set JAVA_HOME.
- Create a adapter with the uDeployArtifactsPublisher template.
- Create a project named uDeploy with two steps. The first step is to do the build; the second step is to use .source command to invoke the XML Adaper you just created. The command of the step should be “.source uDeployPublisher”.
- Modify the environments of the project base on your situation. Make sure to set the UCLIENT_PATH to [BF install path]/jas_utilities/jars
Run the Example
- Run the uDeploy project, you will find it runs successfully.
- Check the BOM list, you will see the published artifacts shown in BOM.
- Log in to uDeploy and check the code station, you will see the build artifacts have been uploaded to the code station successfully.
Part II, Download Artifacts
Overview
As shown in above picture, Build Forge can also download artifacts from uDeploy Code Station if needed.
The design of the integration is simple, as uDeploy has provided the uDeploy Client for the third parties to do the integration with uDeploy. Build Forge will leverage this component. Besides that, Build Forge also need uDeploy Enhanced Client to be able to download artifacts.
Build Forge provides an uDeploy artifacts download xml adapter, it sends two uDeploy commands to uDeploy through uDeploy Client and uDeploy Enhanced Client. The first commands is used to get the artifacts resource location in uDeploy Code Station, if it is successful, the second command will download them.
User can change the environment variables in Build Forge to use the XML Adapter.
Environment variable | Intro |
UCLIENT_PATH | The uClient install path in the os, will be the [BF install path]/jas_utilities/jars |
UDEPLOY_SITE_URL | The uDeploy url |
UDEPLOY_SITE_USERNAME | The uDeploy username |
UDEPLOY_SITE_PASSWORD | The uDeploy password |
BUILD_COMPONENT | The component name |
BUILD_VERSION | The component build version name |
BUILD_PATH | The component build path |
SET_FILE_EXECUTE_BITS | False by default |
SET_VERIFY_FILE_INTEGRITY | True by default |
BUILD_LABEL | The version name which you want to download artifacts from |
Usage Example
uDeploy Side
- Login to uDeploy and create a component named helloworld.
- Create a version for the component and upload some files for the version.
Build Forge Side
- Make sure you have set JAVA_HOME.
- Create a adapter with the uDeployArtifactsDownloader template.
- Create a project named uDeploy with one step. the step is to use .source command to invoke the XML Adaper you just created.The command of the step should be “.source uDeployDownloader”.
- Modify the environments of the project base on your situation. Make sure to set the UCLIENT_PATH to [BF install path]/jas_utilities/jars
Run the Example
- Run the uDeploy project, you will find it runs successfully.
- Check the BOM list, you will see the downloaded artifacts shown in BOM.
- Open the target directory, you will see the downloaded artifacts in the directory.
Reference
About the author
Forest Huo is a developer of IBM Build Forge Team. He works for IBM in China Development Lab. Beijing. He can be contacted at huozz@cn.ibm.com.
Copyright © 2013 IBM Corporation