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.
-
From the IBM® UrbanCode™
Build dashboard,
click Templates, then click Process.
-
Click Create.
-
Using the New Process Template dialog, type a name for the source template
in the Name field.
-
Select Build Process from the Type list.
-
Click Save.
After you save the template, you can add properties, artifacts, and resources to it.
-
Define a process for the
template.
-
Add a resource to the template.
Resources can be added during design time, or added dynamically by a script.
-
Using the page for the process template, click Add Resource.
-
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.
-
To obtain an exclusive lock on the resource, select Yes for the
Exclusive option.
-
Click Save.
-
Optional. Add a property to the template.
-
Optional. Configure artifact sets.
-
Using the page for the process template, click Artifacts, then click
Add Artifact Config.
-
Using the Artifact Configurations pane, select an artifact set from the
Artifact Set list.
-
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}
.
-
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 dist
directory. You can also use process
and project properties to define the pattern.
-
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.
-
Click Save.
-
Click Save.