Creating build process templates

Build process templates provide properties, resources, and artifact sets to processes managed by the parent project.

Before you create a build process templates, create a job that you want to attach to the template. For information about creating jobs, see Creating jobs. If you want to configure resources for the template, create them before you start to work on the template. See, Creating lockable resources. If you want to configure artifact sets for the template, create them before you start to work on the template. See, Creating artifact sets.
  1. From the IBM® UrbanCode™ Build dashboard, click Templates, then click Process.
  2. Click Create.
  3. Using the New Process Template dialog, type a name for the source template in the Name field.
  4. Select Build Process from the Type list.
  5. Click Save.
    After you save the template, you can add properties, artifacts, and resources to it.
  6. Define a process for the template.
  7. Add a resource to the template.
    Resources can be added during design time, or added dynamically by a script.
    Note: Resources are created with the Lockable Resources page. See, Creating lockable resources.
    1. Using the page for the process template, click Add Resource.
    2. Using the Add Resource to Lock dialog, determine whether you want to add the resource now, at design time, or add the resource at run time with a script.
      To add a resource at design time, select it from the Explicit Resource list. Otherwise, enter a BeanShell script in the Scripted resource area. The script must return the name of the resource, or a LockableResource object. To use a property, you use this syntax return PropertyLookup.get("property_name"). If the property returns null or an empty string, no lock is used during the build. If the name resource does not exist, it is created.
    3. To obtain an exclusive lock on the resource, select Yes for the Exclusive option.
    4. Click Save.
  8. Optional. Add a property to the template.
    For information about creating properties, see Creating project template properties.
  9. Optional. Configure artifact sets.
    Note: Artifact sets are created with the Artifact Sets page. See, Creating artifact sets.
    1. Using the page for the process template, click Artifacts, then click Add Artifact Config.
    2. Using the Artifact Configurations pane, select an artifact set from the Artifact Set list.
    3. Specify the base directory in the Base Directory field.
      The directory is relative to the working directory when the Publish Artifacts step runs. To use the working directory, enter the period character '.'. You can use process and project properties to define the location, such as ${property: value}.
    4. Specify the artifacts to retrieve in the Include Artifacts area.
      You can use the * and ** wildcards to define the pattern. The ** wildcard indicates every directory; the* wildcard indicates every file. For example, the pattern dist/**/* retrieve every folder and file beneath the distdirectory. You can also use process and project properties to define the pattern.
    5. To exclude artifacts that would otherwise be included, specify them in the Exclude Artifacts area.
      You can use process and project properties to define the pattern.
    6. Click Save.
  10. Click Save.