Creating and managing build definitions

You can create Jazz™ build definitions that are based on various build templates, such as Rational® Build Forge®, Ant, command line, or Maven. This topic describes how to create and configure a command line definition for a build script. If you must create a build definition by using the other build templates, the steps are similar.

Procedure

  1. In the web client, in the upper left, click the Home Menu icon. Expand Change and Configuration Management and click a project name.
  2. Open your project, and click Builds > Welcome to Builds and, on the Welcome to Builds page, click Create build definition. The New Build Definition wizard opens.
    Note:
    • Alternatively, click Builds and, under Create, click Build Definition.
    • To create a build definition in a folder, click Builds and, under Browse, click Build Definitions. Hover over a folder and click the Create build definition icon Create build definition icon.
  3. On the Create or Copy Build Definition page, complete the following steps:
    1. To select the project or the team area for which you want to create the build definition, beside the Project or team area in which to create the build definition field, click Browse.
    2. To create a new build definition, click Create New.
      Tip: To use an existing build definition as the basis for a new one, click Copy Existing, select a build definition to copy, and click Finish.
      Note: You cannot create and edit Enterprise Extensions build definitions by using the web client.
    3. In the ID field, enter a build definition ID.
    4. In the Description field, enter a description for the build definition.
    5. From the Choose a build definition type list, select Command Line - Jazz Build Engine and click Next.
  4. Optional: If you use Engineering Workflow Management source control, on the Pre-Build page, select Jazz Source Control and click Next.
  5. On the Post-Build page::
    • Select ECJ Publishing to publish log files generated by the Eclipse compiler for Java™ (ECJ).
    • Select JUnit Publishing to publish JUnit XML log files.
    • Select Post-build Deliver to configure when to deliver components to a stream after a build.
      Note: Post-build deliver actions are not enabled for personal builds.
  6. Click Next.
  7. On the Additional Configuration page, select the additional options to include and click Finish.
  8. In the Build Definition editor, in the Overview tab, add supporting build engines.
  9. On the Command Line tab, in the Command field, type the command that triggers the build script.
  10. To schedule builds, click the Schedule tab and complete the following steps:
    1. To enable build scheduling, under Schedule, select Enable scheduling for this build.
    2. Under Selected Schedule Entry Details, enter the following details:
      • Under Build Time, specify either continuous build intervals in minutes, or a specific build time.
      • Under Build Days, select the days of the week that the build runs.
      Note: In Microsoft Internet Explorer, you cannot add a new schedule entry. However, you can edit the existing schedule entry details.
  11. If you select Email Notification when you specify additional configuration options, on the Email Notification tab, define when and to whom to send the email notifications for build lifecycle events.
    Note: To edit an existing email notification, under Notification Criteria, select a criterion. Under Selected Notifications Criterion Details, click Edit. After you finish editing, click Save.
  12. Optional: If you select the Jazz Source Control option on the Pre-build page, complete the following steps:
    Note: Ensure that the build definition refers to a dedicated build workspace and not the team stream, so that the builds are isolated from ongoing changes to the stream.
    1. Click the Jazz Source Control tab.
    2. Under Build Workspace, click the Select a Build Workspace icon Select a build workspace icon.
    3. In the Enter stream or repository workspace name field, enter the repository workspace name. From the Matching items list, select the workspace and click OK.
      Note: Ensure that the build owner owns the selected workspace.
    4. Under Load Options, in the Load directory field, enter the path of the destination directory to load the workspace files.
    5. Select the appropriate option to load the workspace.
      • Do a full load – Deletes the contents of the load directory and fetches all the files from the workspace in every build.
      • Do an incremental load – Does not delete the load directory before loading. Fetches only modified files from the repository, reverts local changes and deletes untracked files.
      • Do an optimized incremental load – Does not delete the load directory before loading. Fetches only modified files from the repository, ignores local changes and untracked files.
        • You cannot specify load rules when the Do an optimized incremental load option is selected as optimized incremental load is not supported when using load rules to load the workspace.
        • When you select the Do an optimized incremental load option, the following build goes through a full load if the build is loading the workspace for the first time. Otherwise, the build goes through an incremental load. Optimized incremental load happens from the next build.
        • Optimized incremental load is not supported in personal builds. The first regular build after a personal build goes through an incremental load and the builds following that would go through an optimized incremental load.
        • For a large workspace size, optimized incremental load is much faster than a regular incremental load.
        • You can confirm if an optimized incremental load happened in a build by looking for the following message in the build log – Invoking optimized incremental load.
        Note:

        The option to Do a full load and Do an incremental load replace the Delete the directory before loading option. The Do a full load option is selected by default for older build definitions, created before EWM release 7.0.1, where the Delete the directory before loading option is selected. The Do an incremental load option is selected by default for older build definitions where the Delete the directory before loading option is not selected.

    6. Optional: To define a subset of component files and folders for the build to load, click Load components by using a load rule file and then select a load rule file. When a load rule file is specified, only the components for which the load rules are specified are loaded according to the rules.
      Note: The Load Policy field is not displayed for build definitions that were created in Rational Team Concert versions earlier than 605. If you select the Switch to the new format for loading components check box, the load policy user interface is displayed.
    7. Optional: To build only if there are changes that are delivered to a build stream, select Build only if there are changes accepted.
      Note: This option is applicable for scheduled builds only.
      Tip: To set up a continuous integration build, set the build schedule to run at a specific time interval, for example, after every 5 minutes. Ensure that the Build only if there are changes accepted option is selected. If no changes are accepted when the scheduled build runs, the build is deleted.
    8. Optional: To restrict the components that are loaded during the build, select the Exclude some components option.
      Note: The flow targets of the build workspace can be scoped to include only specific components from the target streams. Only the specified components are considered in the pre-build check to verify whether there are Engineering Workflow Management source control changes to build. Also, the snapshot for the build includes only these components. For more information, see Flow targets.
    Tip: To edit or delete a build definition, click Builds and, under Browse, click Build Definitions. A list of build definitions that are available in the current project is displayed. To edit a build definition, hover over the build definition and click the Edit icon Edit icon. To delete a build definition, hover over the build definition and click the Delete icon Delete icon.