Lesson 6: Creating a project

You use projects to configure and run builds. After a build runs, projects provide a wealth of information that you can use to manage the project lifecycle and troubleshoot problems.

Before you begin

Ensure that you completed all the preceding steps before you start this lesson.

About this task

Projects are built from templates. In this lesson, you use the templates that you made earlier to create the tutorial project. To define the project, you select the process and process definition templates and provide values for the properties that are defined by them.

You can run builds automatically on a schedule, or you can run builds manually, as you do in the tutorial. When you start the build, the job that you created with the job template is started. The project determines which source code to use and manages dependencies. Each build generates a unique build life

As the project runs, the build life provides feedback about the build's status and generates logs that you can use to troubleshoot problems. If projects are configured to run tests, as the tutorial project is, test results are available on the Tests tab for the build life.

Procedure

  1. On the left navigational panel, click Projects, and then click Create.
  2. Select the project template that you created in Lesson 5, Git Project Template.
  3. In the Name field, type Ant.
    Note: The build uses the project's name to identify the HCL DevOps Deploy (Deploy) component. If you use another name for your project, make sure there is a component with the same name in Deploy.
  4. Click Save.
    The Configuration tab for the project is displayed. You use this page to configure projects. You can also run project builds on this page. Later, you will use this page to run the tutorial project.

Configuring the project build process

A project must be associated with a build process. A project can be associated with any number of build processes.

Procedure

  1. Ensure that the Configuration tab for the Ant project is displayed; then, under Build Processes, click New.
  2. In the New Process window, in the Template list, select Ant Build Process, and then click Select.
    The fields that you see depend on the selected template. In this case, several fields are derived from the process template that you created the previous lesson.
    Note: If the only template you have is the one you created earlier in the tutorial, the template is automatically selected and this step is skipped.
  3. In the Name field, type GitHub Build Process.
  4. In the Build Script field, accept the build.xml value.
    You defined the default value, build.xml, when you created the process template.
  5. In the Product Version field, accept the 1 value.
    You defined the default value when you created the process template.
  6. In the Artifacts Base Dir field, type dist/lib.
    This overrides the default value you defined earlier.
  7. In the Include Artifacts field, type *.jar.
    This overrides the default value you defined earlier.
  8. Leave the Exclude Artifacts field blank.
  9. In the Default Ant Targets field, type main junit-batch.
    You can use another target, main junit-batch-with-failure to automatically fail the Ant build step and produce a lot of JUnit test results.
  10. In the JUnit Report Base Dir field, type, build/testcases/xml.
  11. Click Save.

Results

The Configuration tab for the new build process is displayed.

Configuring the project source

You define a project's build source by assigning a source template to a build configuration and defining values for its properties.

Before you begin

Ensure that the Configuration tab for the build process that you defined in the previous section is displayed.

About this task

You define the source configuration by selecting the source template that you created earlier, and by using template properties to identify the source location.

Procedure

  1. Under Source Configuration, click Create.
  2. In the New Source from Template dialog box, in the Source Template list, select the source template that you created earlier, gitHubSource, and then click Select.
    Note: If the only template you have is the one you created earlier in the tutorial, the template is automatically selected and this step is skipped.
  3. In the Name field, type gitHubSource.
  4. In the Repository list, select the repository that you created earlier, GitHub.
  5. In the Remote URL field, type Serneum/ant.git.
    You defined this field and the next two fields when you created the source template.
  6. In the Remote Name field, accept the default value origin.
    You defined the default value for this field when you created the source template.
  7. In the Branch field, type ANT_18_BRANCH.
    This overrides the default value, master, you defined earlier.
  8. Click Save.

Results

With the build process defined and the build source identified, the project is complete. The finished project is shown in this figure:The finished Demo Build process

Lesson checkpoint

In this lesson, you created a project and defined a build process and a build source.

About this task

The project is constructed from the templates that you made earlier in the tutorial. All projects are built from templates. When you create a project, you identify the templates and provide property values for them. With this lesson finished, it's time to run the project.