Creating 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. 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.
About this task
The following list describes the types of build engines and definitions that you can create and use with Engineering Workflow Management Build:
- Rational Build Forge: Use this build engine and definition with its corresponding projects.
- Rational Build Agent: Use this build engine and related definitions for various types of builds; for example, command-line or enterprise build projects, such as iSeries or z/OS® projects.
- Jazz Build Engine: Use this build engine and related definitions for various types of builds, such as Ant, command-line, or Maven.
- Hudson/Jenkins Engine: Use this build engine together with a Hudson/Jenkins build.
- In the Team Artifacts view, expand the project folder.
- Right-click Builds; then click New Build Definition.
- In the New Build Definition wizard, on the New Build Definition page, accept the defaults and click Next.
- On the General Information page, in the Available build templates pane, select Command Line - Jazz Build Engine and click Next.
- Optional: If you use Engineering Workflow Management source control, on the Pre-build page, select Jazz Source Control and click Next.
- 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.
- Click Next.
- On the Additional Configuration page, ensure that all options are selected and click Finish.
- In the Build Definition editor, click the Command Line tab.
- In the Command field, type the command that invokes your build script.
- Optional: To schedule builds, complete the
- Click the Schedule tab.
- To enable build scheduling, under Schedule, select Enabled.
- Select the first schedule entry.
- In the Build Time pane, specify either continuous build intervals in minutes, or a specific build time.
- In the Build Days pane, select the days of the week that the build runs.
- Optional: If you selected Jazz Source Control in Step 5, complete
the following steps: Note: Ensure that the build definition refers to a dedicated build workspace, rather than the team stream, so that builds are isolated from ongoing changes in the stream.
- Click the Jazz Source Control tab.
- To specify a repository workspace, in the Build workspace pane, click Create.
- In the New Repository Workspace Wizard, on the Select a stream page, select Flow with a stream and in the lower pane, select the
repository stream that you want to build from. This selection enables the repository workspace to accept changes from the stream.
- Click Next.
- On the New Repository Workspace page, in the Repository Workspace Name field, rename the repository workspace and click Next.
- On the Read Access Permission page, select the read access permissions for the repository workspace.
- On the Components to Add page, ensure that your component is selected.
- Ensure that the Load repository workspace after creation check box is cleared and click Finish.
- To specify a build user for the build workspace, in the Workspace Owner dialog box, click Open Workspace.
- In the Repository Workspace editor, in the Owned by field, browse to the location of your special-purpose build user.
- Click Save.
- In the Build Definition editor, in the Load Options pane, in the Load directory field, type the path to the directory on the build machine where workspace files should be loaded.
To define a subset of component files and folders for the build to load, select Load
components by using a load rule file and then select a load rule file. When a load rule
file is specified, only those 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 by using earlier client versions. If you select the Switch to the new format for loading components check box, the load policy user interface is displayed.
To build only if changes are delivered to a build stream, select Build only if there
are changes accepted. This option is only applicable for scheduled builds.
Tip: To set up a continuous integration build, set the build schedule to run at an interval, such as every 5 minutes, and 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.
- Optional: The Components to exclude option can be used to restrict which components are loaded during the build.
- Optional: The flow targets of the build workspace can be scoped to include only specific components from the target stream(s). Only these components are considered in the pre-build check for 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.
- Select any additional options and click Save.