Lesson 7: Running the build

Run the project build process to transform the source code into a distributable component and load it into IBM® DevOps Deploy (Deploy).

To see the finished build objects that are loaded into Deploy, make sure that you complete these tasks before you run the build:
  • Configure an instance of Deploy and the Build agent that you use in the tutorial project can access it.
  • Create an Deploy integration that identifies the Deploy server that you are using in the tutorial.
  • Make sure that your instance of Deploy is running
  • Create a component named Ant in Deploy.
  • Create a version status in Deploy that is named Success.
You run a build by running a build process that is defined for a project. The build process takes the source material and transforms it into the final output by using a job that is assigned to the project. The job in the tutorial project completes these activities:
  1. Checks out source material from the GitHub repository.
  2. Uses Ant to build the project artifacts.
  3. Runs JUnit tests on the build process.
  4. Loads the artifacts into an Deploy component.
  5. Assigns a status of Success to the component in Deploy.

Typically when you run a build, you can use several run-time properties. The number of properties depends on the template. In the case of the tutorial project, the Ant Targets property affects the build’s outcome. If you accept the ${p:?default.ant.targets} default value for the Ant Targets property, the build process uses the main junit-batch value that you defined in the previous lesson. You can overwrite the default value with one of your own, but for the tutorial accept the default value. Another target is discussed later in this lesson.

  1. On the left navigational panel, click Projects, and then expand the project that you created in the previous lesson, Ant.
    Build processes that are configured for the selected project are listed beneath the project, as shown in this figure:
    The builds for the Ant Project listed
  2. Click Ant Build Process.
    The Main tab for the Ant Build Process is displayed.
    The run-time properties for the GitHub Build Process listed

    A project build process can have any number of run-time properties. The user who runs the build can enter values that are related to a particular build or override default values.

  3. Accept the default value in the Ant Targets field.
  4. Click Build.
    The build process starts and the My Activity tab for the build is displayed. The build, with a new build life number, is listed with a status of Running, as shown in this figure:
    The GitHub Build Process running
Refresh the My Activity page. If the build succeeds, the status changes to Complete; otherwise, the status changes to Failed. The project's Main tab contains information about the builds that the project generated. To see information about a build, click the ID for the build life. A completed build of the tutorial project is shown in this figure:
A successful build
If a build fails, you can see information about a failed step. To see a step's output, use the View Output action, as shown in the following figure. Use the log to identify errors and troubleshoot failed steps.
A failed build

The tutorial project is configured to run JUnit tests. To see the types of reports that are created when a build fails, run the build again, but use the main junit-batch-with-failures target in the Ant Targets field. This target automatically fails on the Ant Build step in the Ant Build Job, and generates numerous JUnit reports.

To see the JUnit test results, open the Tests tab for the build.

Lesson checkpoint

In this lesson, you ran a build of the tutorial project and examined its progress, tests, and final output.

In this lesson, you ran a build for the project that you created in the tutorial. The build created artifacts that were loaded into an Deploy component version and assigned a status of Success. Finally, the build created JUnit reports that are available on the Tests tab of the build life.