Lesson 5: Creating a process template

Build a process template for the tutorial project.

In this lesson, you create a process template, define a process, create a property, and an artifact set that is used by the project.
  1. On the left navigational panel, click Templates, click Process, and then click Create.
  2. In the Name field, type Demo 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 that comprise a build.

In order for a job to be used in a project, it must be assigned to the process. A process can have several jobs and their order in the process is determined similarly to the way steps are inserted into jobs. In this lesson, you assign the job you created in the last lesson to a process definition.
  1. On the Build dashboard, click Templates > Process.
  2. In the Process Templates page, click Demo Build Process, and then click Definition.
  3. Click Start, and then select Insert Job After.
    The Insert Job After action is displayed after you click Start, as show in the following figure:
    The Insert Job After action
  4. In the Insert Start Job window, in the Job list, select the job you created in the last lesson, Demo 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 you created when you configured your tutorial system.
    An agent in the agent pool runs the jobs assigned to the workflow.
  7. In the Working Directory list, select Default Workflow Directory.
    An agent's default working directory is:
    agent_directory/var/work/project/
  8. Click Insert Job.
After a job is added to the process definition, the list of available process actions increases. Actions to insert jobs before or after other jobs, or to delete jobs are available, as show in the following figure.

Process definition actions

Creating process template properties

Define the property you referenced in Lesson 2.

In this step, you define the property you referenced in the Maven Build step, ${p:maven.goals}, in Lesson 2.
  1. Using the Demo Build Process, click Properties, and then click Create.
  2. In the Name field, type maven.goals.
  3. In the Label field, type Maven Goals.
  4. In the Display Type list, select Text.
  5. In the Default Value field, type package.
    This is a Maven lifecycle build phase.
  6. Select the Value Required check box.
  7. Click Save.

Creating process artifact sets

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

Ensure that you configured a Maven artifact set before you start this step.
In this lesson, you configure the artifact set that is used by the project.
  1. Ensure that the window for your build process is displayed and click Artifacts, and then click New Artifact Config.
  2. In the Artifact Set list, select the artifact set you created earlier, maven.
  3. In the Base Directory field, type target.
  4. In the Include Artifacts field, type *.jar.
  5. Click Save.

Lesson checkpoint

In this lesson, you created a process template and added a property and an artifact set to it.