Lesson 4: Creating a process template

Build process templates associate processes with project templates.

In this lesson, you create a process template and assign the workflow that you created to it. In addition, you define several project properties and the artifact set that the project uses.
  1. On the IBM® UrbanCode™ Build dashboard, click Templates, click Process, and then click Create.
  2. In the New Process Template dialog box, in the Name field, type Ant Build Process.
  3. Under Type, make sure that Build Process is selected.
  4. Click Save.
The Main tab for the new process template is displayed.

Creating a process definition

Process definitions identify the jobs in a build.

Process definitions define the jobs and steps in a build. When you place a job in a process definition, you specify several options, such as the agent pool and the working directory. Process definitions can have several jobs attached to them and, like the steps in a job, you control their order. Process definitions are created with reusable templates. In this lesson, you create a process definition and assign the job that you created in the previous lesson to it.
  1. On the IBM UrbanCode Build dashboard, click Templates > Process.
  2. In the Process Templates page, click Ant Build Process, and then click Definition.
  3. In the Definition area, click Start, and then select Insert Job After.
    The Insert Job After action is displayed after you click Start, as shown in this figure:
    The Insert Job After action
  4. In the Insert Start Job window, in the Job list, select the job that you created in a previous lesson, Ant Build Job.
  5. In the Pre-condition list, select Always.
  6. In the Agent Selection area, select Agent Pool Selection, and then select the agent pool that you created when you configured your tutorial system.
    An agent in the agent pool runs the jobs that are assigned to the process definition.
  7. In the Working Directory list, select Default Workflow Directory.
    An agent's default working directory is as follows:
    agent_directory/var/work/project/project_name

    When this option is selected, the agent creates a folder for each project that it runs.

  8. Accept the default values for the other fields and click Insert Job.
    The Ant Build Job is inserted in the Ant Build process definition.

Creating process template properties

Define the property that you referred to in Lesson 2.

In this step, you define properties that every project that uses the template can use. Because this template is related to Ant builds, most properties are related to Ant builds. Some properties have default values defined for them, while others are left to be defined later.
  1. Click Properties, and then click Create.
    Use the values in the following table to create the properties for the tutorial workflow. You can enter any text for the property labels but remember that the labels are displayed to users who use the template. In addition, if you use the suggested label text, it is easier to follow the tutorial in Lesson 6. If a cell is empty in the Default value column, leave the corresponding Default Value field blank. Accept the default values for the other fields. The descriptions you enter are displayed on some of the project's dialog boxes. Descriptions for some of the properties are provided in the figure below.
    Table 1. Tutorial process template properties
    Name Label User May Override Type Required Default Value
    dir.offset Directory Offset No Text False
    build.script.name Build Script No Text True build.xml
    ant.targets Ant Targets Yes Text False ${p?:default.ant.targets}
    build.properties Build Properties Yes Text Area False
    ant.properties Ant Properties Yes Text Area False
    product.version Product Version No Text True 1
    artifacts.base.dir Artifacts Base Dir No Text True .
    artifacts.includes Include Artifacts No Text Area True *
    artifacts.excludes Exclude Artifacts No Text Area False
    default.ant.targets Default Ant Targets No Text False
    junit.report.base.dir JUnit Report Base Dir No Text True
    The artifact set you create in the next section uses three properties: artifacts.base.dir, artifacts.includes, artifacts.excludes.
  2. Click Save after you finish each property.
The properties are listed on the Properties tab of the Ant Build Process process template.

The Ant Build Process template properties

Creating process artifact sets

Generated artifacts are assigned to an artifact set. An artifact set is a collection of build artifacts.

Before you begin this lesson, make sure that you created the artifact set as described in Configure the tutorial system.
In this lesson, you configure the artifact set the project uses. The items in the artifact set are loaded into IBM UrbanCode Deploy as a component version.
  1. Ensure that the window for your build process is displayed, click Artifacts, and then click New Artifact Config.
  2. In the Artifact Set list, select the artifact set you created earlier, dist.
  3. In the Base Directory field, type ${p:artifacts.base.dir}.
    This property and the next two properties refer to the properties you created in the last section. The default value,which was defined in the last section, means the process will use the current directory.
  4. In the Include Artifacts field, type ${p:artifacts.includes}.
    The default value,which was defined in the last section, means the process will include all artifacts.
  5. In the Exclude Artifacts field, type ${p?:artifacts.excludes}.
  6. Click Save.

Lesson checkpoint

In this lesson, you created a process template and defined a process for it. You created properties and added an artifact set to the template.