Set up Your First Build

Version 4 by Robin Shen
on Nov 28, 2009 09:34.


compared with
Current by Robin Shen
on Nov 28, 2009 11:37.


 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 2 changes. View first change.

 h1. Situation
 Set up build for a project to:
 # Check out source code from SCM.
 # Build and run unit tests.
 # Publish generated artifacts, api documents, and test reports
  # Publish generated artifacts, api documents, and test reports.
 # Label SCM using the build version if the build is successful.
 # If failed, notify all commit users.
  
 h1. Demonstration
 Visit the [demo project|http://demo.pmease.com/build/66.latest/], 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.
  
 h1. Resolution
 # Define next build version at [basic setting of the demo project|http://demo.pmease.com/setting/basic/66/].
 # Switch to [advanced setting of the demo project|http://demo.pmease.com/setting/advanced/66/]. The email setting is enabled including a forced notification entry, with _<committers>_ as the receiver and _build.failed_ as the notify condition.
 # Switch to [repository definition of the demo project|http://demo.pmease.com/setting/repositories/66/]. A repository is defined according to SCM setting of the project.
 # Switch to [step definition of the demo project|http://demo.pmease.com/setting/steps/execution/66/]. A sequential composition step is defined as the master step, and below steps are included in the sequential step:
 ## 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.
 ## A Ant build step to build source code and run JUnit tests. Specifically, the _build properties_ is defined like below:
 {code}
 component.version=${build.version}
 {code}
 With this setting, the Ant property _component.version_ is defined as version of current build and this property will be used in the Ant build script to suffix name of generated jar file with current build version.
 ## 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.
 ## 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.
 ## A publish junit reports step to publish JUnit xml reports. The JUnit xml reports need to be generated in the Ant build script through the JUnit task. A sample JUnit task running JUnit tests and generating xml reports is like below:
 {code}
 <junit printsummary="yes" failureproperty="test.failed">
  <formatter type="xml"/>
  <batchtest todir="build/junitReports">
  <fileset dir="test">
  <include name="**/*.java"/>
  </fileset>
  </batchtest>
  <classpath refid="classpath"/>
 </junit>
 {code}
 Reviewing the workspace tab will be helpful when define this step.
 ## A label step to create label in the repository using the build version. In this example, you will need to specify the property _Url to Label_ when define [repository of the demo project|http://demo.pmease.com/setting/repositories/66/].