Set up Your First Build

You are viewing an old version (v. 2) of this page.
The latest version is v. 3, last edited on Feb 23, 2020 (view differences | )
<< View previous version | view page history | view next version >>

Situation

Set up build for a project to:

  1. Check out source code from SCM.
  2. Build and run unit tests.
  3. Publish generated artifacts, api documents, and test reports.
  4. Label SCM using the build version if the build is successful.
  5. If failed, notify all commit users.

Demonstration

Visit the demo project, and hit the run button to generate the new build. After build finishes, you will see published artifacts as well as api documents and junit reports.

Resolution

  1. Define next build version at general setting of the demo project.
  2. Switch to notification setting of the demo project. A notification is defined with receivers set as <committers since previous build> and notification condition set as if build is failed.
  3. Switch to repository definition of the demo project. A repository is defined according to SCM setting of the project.
  4. Switch to step definition of the demo project. A sequential composition step is defined as the master step, and below steps are included in the sequential step:
    1. A checkout step to check out from the repository defined in step 3. The source code will be retrieved into workspace directory of the project as indicated by destination path property of the repository.
    2. A Maven build step to build source code and run JUnit tests. Specifically, the build properties is defined like below:
      component.version=${build.version}
      

      With this setting, the Maven property component.version is defined as version of current build, and this property is used as project version in pom.xml.

    3. A publish artifacts step to publish generated jars and release notes from workspace of the configuration. Reviewing the workspace tab will be helpful when define this step.
    4. A publish html reports step to publish javadoc API html files from workspace of the configuration. Reviewing the workspace tab will be helpful when define this step.
    5. A publish JUnit reports step to publish JUnit xml reports generated by the build. Reviewing the workspace tab will be helpful when define this step.
    6. A label step to tag SCM using the build version.
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.