DevOps Automation

 View Only

How to get started with IBM UrbanCode Build (UCB)

By Randall Langehennig posted Fri July 08, 2022 12:41 PM


How to Get Started with IBM UrbanCode Build


This guide is intended to outline the high-level steps required to setup a build project in IBM UrbanCode Build.

IBM UrbanCode Build (UCB) leverages templates which are a requirement for any type of build you want to configure.   Creating templates are needed before you can setup a “build project” on the home dashboard.

To get started, you will need to create these four templates:

  1. Create a Job Template (e.g. UCB-Tutorial-Job)
  2. Create a Source Template (e.g. GitHubSource-Tutorial)
  3. Create a Process Template (e.g. Ant-Build-Process)
    1. Configure an Artifact Set (e.g. dist-tutorial)
  4. Create a Project Template (Git Project Template – Tutorial)

Once the templates are in place, you can then add your new “project” to the home dashboard in UCB.   You follow these steps to get this configured:

  1. Add your “build project” to the home dashboard
  2. Configure a “build process” for the project
  3. Add your “source configuration” to the build process.

You can then start building your code!   Let’s take a look at an example following the steps described above.

Creating the Four Templates

Template 1: Creating your Job Template

The Job template includes the standardized build steps that you would like to include in any build process derived from this template.   Here are some screen shots of the job template I created that leverages “git” and “ant”:

You can insert steps before or after a step easily using the Action buttons on the right-hand side.   The steps you add will leverage plugins to perform various tasks.   Here is a screen shot showing step options as you add a step:

Template 2: Creating a Source Template

A source template is used to connect to various source code repositories from git, perforce, subversion, and more.   Here is a screen shot of my source template:  

Rather than hard-coding the remote url, the branch name, and more, you can leverage properties to allow them to be reusable and abstract.   Be sure to define the properties in the properties sub-tab as shown below:

Template 3: The Process Template

In your process template, you will go to the “Definition” sub-tab and insert your Job (that was created as our first template) after the Start stanza as shown below:

You will also add the properties required for your job in the Properties sub-tab:

You then go to the “Artifacts” sub-tab and add a “New Artifact Configuration” as shown below:

The output of the build will be placed in this artifact set.   One thing to keep in mind, a build project can have dependencies on other components that may not be built by IBM UrbanCode Build.   You can create a CodeStation project which model external tools or libraries as IBM UrbanCode Build projects.

Template 4: Creating a Project Template

Finally, you will create a project template.   When you create a project template, you identify the agent pool that it uses and you configure pre-processing options.   Here is a screen shot:

Builds can be triggered by repository events, such as source code changes or if a dependency changed.   There are three trigger types:

  1. Scheduled Trigger
  2. Repository Trigger
  3. Post-Process Trigger

Create your Project to the Main Dashboard

Once the templates are in place, you can now go to the main Projects dashboard as shown below and add your new build project:

Click the “Create” button as highlighted above and from the Template pulldown, select your Project Template:

Give your Project a name and add it to a team like the “System Team”:

In the “Configuration” sub-tab, add a New build process.   Select the Process Template you created earlier:

Press the “Select” button.   You will then see this screen:

Enter the proper values for the required properties and any other optional properties.   Click Save and you will then see a screen as shown below:

Finally, you will create a “Source Configuration” that uses the “Source Template” you created earlier.   This will include a repository that specifies the location of the source code (in git in this case) as shown below:

You are ready to start building your code.   The beautiful thing about this approach is you can setup a standardized build server that helps your teams to quickly on-board new build projects using the reusable templates provided by IBM UrbanCode Build.

Running the Build

To trigger the build, simple go to your build process and click the “Build” button as highlighted below:

This will create a new build life and the build process will begin.   You can click on the build life and see the build progress in real-time and view the results as shown below:

I hope this was a good introduction to templates in IBM UrbanCode Build.   For a more detailed walkthrough, please find a tutorial here: