JOnAS header

Guide to how to do the JOnAS Continuous Integration work

CVICSE

ZongFu Liu

Abstract

This guide explain the Continuous Integration process using Bamboo tool


List of Tables

2.1.

Preface

Welcome to the new users of JOnAS 5.0! This guide is intended to introduce to do the JOnAS 5.0 Continuous Integration Using Bamboo.

Chapter1, Introduction of how to do the JOnAS5 Integration work manually wants to help you know how to setup the JOnAS integration work environment and do the work manually.

Chapter2, Using Bamboo to define the JOnAS integration work wants to help you to use bamboo to setup the integration environment and define JOnAS integration activities.

Chapter3, Using Bamboo to manage the JOnAS integration work wants to help you to use bamboo to define JOnAS integration activities and setup the integration environment.

Note that this guide want to stay simple and has not the ambition to resolve all the problems that can be encountered in the real life that can be really complex.

For more experimented users that need to perform more complex tasks it is recommended to look the JOnAS 5 Configuration Guide and Bamboo documentation.

Chapter 1. Introduction of how to do the JOnAS5 Integration work manually

1.1. How to build the JOnAS manually

Checkout the JOnAS source code from the subversion repository to the directory <jonas_src>. To do so, simply configure the SVN repository URL (if you are using a GUI subversion client, configure it appropriatly):

svn://svn.forge.objectweb.org/svnroot/jonas/jonas/trunk/jonas

Before building JOnAS, you have to set up the environment variables including JONAS_ROOT, CATALINA_HOME. You will also have to update your PATH variable as well.

  • Unix platforms

    Open a new terminal and proceed as follows:

    bash>export JONAS_ROOT=<jonas_install_dir>
    bash>export CATALINA_HOME=<tomcat_install_dir>
    bash>export PATH=${PATH}:${JONAS_ROOT}/bin/unix

    or

    tcsh>setenv JONAS_ROOT=<jonas_install_dir>
    tcsh>setenv TOMCAT_HOME=<tomcat_install_dir>
    tcsh>setenv PATH ${PATH}:${JONAS_ROOT}/bin/unix
  • Windows platforms

    Open a new DOS window and proceed as follows:

    C:>set JONAS_ROOT=<jonas_install_dir>
    C:>set CATALINA_HOME=<tomcat_install_dir>
    C:>set PATH=%PATH%;%JONAS_ROOT%\bin\nt

The prerequisite of building JOnAS are to use the JDK 1.5, Maven 2.0.6 and Ant 1.6.5. Please to assure that you've installed the JDK1.5, Maven 2.0.6 and Ant 1.6.5.

To build the jonas,simply use the following commands:

cd <jonas_src>
mvn clean install
ant clean install

1.2. How to build and run the JOnAS testsuite manually

1.2.1. To checkout the JOnAS Testsuite

Checkout the JOnAS testsuite source code from the subversion repository to the directory <jonas_tests>.To do so, simply configure the SVN repository URL (if you are using a GUI subversion client, configure it appropriatly):

svn://svn.forge.objectweb.org/svnroot/jonas/jonas/trunk/jonas_tests

Before building JOnAS Testsuite, you have to set up the environment.

1.2.2. How to setup the environment in the user's home directory

Please check the user environment . Change the directory to the user's home directory, and check the jb.config directory and proxy.properties.

The 'jb.config' will be used by newjb tool for creating a new JONAS_BASE environment.

We need to provide a proxy properties file only when using the proxy to access the internet. So if you use a proxy, you need to define the properties of the proxy in the configuration file of 'proxy.properties' and then put it in the user's home directory. If your machine can access the internet directly, you don't need provide it .

[Note]Note

Please assure there is not a property file named 'proxy.properties' in the user's home directory when you don't need a proxy.

Under the directory of '${user.home}/jb.config', there are two sub-directories: conf and lib.

Screenshot 1.'the directory of ${user.home}/jb.config ':

Open the file '${user.home}/jb.config/conf/jonas-newjb.properties' please assure the configurations as blow:

#Services
jonas.services=registry,jmx,jtm,db,security,mail,wm,resource,ejb,ws,web,ear,discovery

#Jms
jms.port=16010
jms.topics=sampleTopic,InvoiceTopic
jms.queues=sampleQueue,OrderApprovalQueue,OrdersQueue,MailCompletedOrderQueue,SupPurchaseOrderQueue,MailOrderApprovalQueue,MailQueue

#Carol
carol.allport=1099
carol.defaultprotocol=jrmp
carol.jrmpopt=false

#Web
webcontainer.port=9000
# Tomcat/Jetty
webcontainer.service.defaultname=tomcat

#Db
db.port=9001

#Discovery
discovery.sourceport=9888
discovery.greetingport=9899
discovery.mcastaddr=224.224.224.224
discovery.mcastport=9080

#Database
rajdbc.defaultname=hsql

#DB connections
rajdbc.hsql.user=jonas
rajdbc.hsql.password=jonas
rajdbc.hsql.url=jdbc:hsqldb:hsql://localhost:9001/db_jonas
rajdbc.hsql.drivername=org.hsqldb.jdbcDriver
rajdbc.hsql.jndiname=jdbc_1
rajdbc.hsql.jdbcdriverjarfile=none
rajdbc.hsql.mappername=rdb.hsql

#Mail
mail.session.name=mailSession_1
mail.mimepartds.name=mailMimePartDS_1
mail.to=jean.dupont@objectweb.org
mail.subject=test mail

Open the file '${user.home}/proxy.properties' please assure the configurations as blow:

proxyHost=...
proxyPort=...
nonProxyHosts=.....
proxySet=true

1.2.3. How to setup the environment variable

Before building and running JOnAS testsuite, you have to set up the environment variables including JONAS_ROOT, JONAS_BASE, CATALINA_HOME, XMLUNIT_HOME, HTTPUNIT_HOME, HTTP_PORT . You will also have to update your PATH variable as well.

  • Open a new terminal and proceed as follows:

    bash>export JONAS_ROOT=<jonas_install_dir>
    bash>export JONAS_BASE=<jonasbase_dir>
    bash>export CATALINA_HOME=<tomcat_install_dir>
    bash>export XMLUNIT_HOME=<xmlunit_install_dir>
    bash>export HTTPUNIT_HOME=<httpunit_install_dir>
    bash>export HTTP_PORT=9000
    bash>export PATH=${PATH}:${JONAS_ROOT}/bin/unix

    or

    tcsh>setenv JONAS_ROOT=<jonas_install_dir>
    tcsh>setenv JONAS_BASE=<jonasbase_dir>
    tcsh>setenv CATALINA_HOME=<tomcat_install_dir>
    tcsh>setenv XMLUNIT_HOME=<xmlunit_install_dir>
    tcsh>setenv HTTPUNIT_HOME=<httpunit_install_dir>
    tcsh>setenv HTTP_PORT=9000
    tcsh>setenv PATH=${PATH}:${JONAS_ROOT}/bin/unix
  • Windows platforms

    Open a new DOS window and proceed as follows:

    C:>set JONAS_ROOT=<jonas_install_dir>
    C:>set JJONAS_BASE=<jonasbase_dir>
    C:>set CATALINA_HOME=<tomcat_install_dir>
    C:>set XMLUNIT_HOME=<xmlunit_install_dir>
    C:>set HTTPUNIT_HOME=<httpunit_install_dir>
    C:>set PATH=%PATH%;%JONAS_ROOT%\bin\nt

1.2.4. How to build and run the JOnAS Testsuite

  • To build the JOnAS Testsuite only:

    cd <jonas_tests>
    ant install
    

  • To build and run the JOnAS Testsuite:

    cd <jonas_tests>
    ant run_nightly

1.3. Conclusion

From the above as you know, the JOnAS integration work consists three main building activities :

cd <jonas_src>; mvn clean install
cd <jonas_src>; ant clean install
cd <jonas_tests>; ant run_nightly

In the next chapter , it will introduce how to use the Bamboo to define the JOnAS integration building work which consists of three main JOnAS integration activities.

Using Bamboo, you can define the the Integration work and then run and monitor the activities.

Bamboo also provide many kinds of reports for the results of integration activities.

Chapter 2. Using Bamboo to define the JOnAS integration work

First , you need to login into the Bamboo system as administrator.

[Note]Note

please assure that the user home environment has been setup, refer to 'How to setup the environment in the user's home directory in the chapter1.

2.1. Setup the Builds environment in Bamboo

Using Bamboo to do the JOnAS integration work, you need to configure the JDK, builds(Maven, Ant) and environment variables.

JDKs:             J2SDK 1.5
Builders:         Maven 2.0.6, Ant 1.6.5
Global variables: define the environment property to pass the enviroment variables vaules(JONAS_ROOT, JONAS_BASE, CATALINA_HOME, XMLUNIT_HOME, HTTPUNIT_HOME)

Click the 'Administration' link in the top navigation bar, to enter into the administrator page:

2.1.1. How to configure the JDK

Click the 'JDKs' link in left navigation column. This will display a list of Available JDKs. To configure a JDK in Bamboo is same with the Builders. Bamboo will automatically add the JDK which default JAVA_HOME entry points at. In the Label field, the name is that will appear in the 'Builder JDK' drop down list when a plan is configured.

2.1.2. How to configure the Builders

Click the 'Builders' link in left navigation column. The Builders in Bamboo are the build tools , such as Ant, Maven, Make, etc. This will display a list of Available Builders that have been configured in Bamboo, with an empty field at the bottom of each column for adding a new Builder. In the Label field, type the name that will appear in the 'Builders' drop down list when a plan is configured.

2.1.3. How to configure the Global Variables

Click the 'Global Variables' link in the left navigator column and this will display a list of variables that have been configured in Bamboo, with an empty field at the bottom of each column for adding a new variable. In the 'Key' field, type the key of the variable that you want to identify the variable. In the 'Value' field, type the value of the variable. Then click the 'Save' button.

2.2. Create the plans in Bamboo for JOnAS Integration Activities

Now you will define the build plan in Bamboo for every integration activities of the JOnAS.

Table 2.1. 

Build Plan in BambooActivity
Maven Buildcd <jonas_src>; mvn clean install
Ant Buildcd <jonas_src>; ant clean install
Tests Buildcd <jonas_tests>; ant run_nightly


2.2.1. How to create a project and a 'Maven Build' plan

To create a new plan for ' Maven Build':

1.Click the 'Create Plan' link in the top navigation bar.
2.Enter the required information in the 6 screens as described below. When you return to the Dashboard, your new plan (and new project, if applicable) will be displayed in the 'All Projects' list.

Screenshot 1. 'Plan Details' :

1. 'Plan Details':

  • Project — When you create a new plan, you can either add it to an existing project or create a new project. Either:

    • Select the appropriate project from the drop-down list;

      or

    • Select 'New Project' and complete the following two fields:

      1. Project Name— Type a descriptive name ('Maven Build') that will identify your project on the Dashboard and in reports.

      1. Project Key — Type a logical contraction of the Project Name ('J5'). The Project Key will be included in the plan's Build Results keys ('J5-MVN-XXX'), so you may want to make it no longer than 3 or 4 characters. The Project Key must be unique within your Bamboo system. The Build Results keys'suffix 'XXX' identifies the XXX test results.

  • Build Plan Name — Type a name that will identify the plan within its project ('Maven Build'). Note that the Build Plan Name, which is displayed throughout Bamboo, is always accompanied by its Project Name.

  • Build Plan Key — Type a logical contraction of the Build Plan Name. The Build Plan Key ('MVN') will be included in the plan's Build Results keys ('J5-MVN-XXX''), so you may want to make it no longer than 3 or 4 characters. Note that the Build Plan Key only has to be unique within the project.

Screenshot 2. 'Source Repository':

2. 'Source Repository':

  • 'Repository' — Select the type of repository from which Bamboo will check-out and build this plan's source-code. The following fields will vary depending on what type of repository you select:

    • Subversion:

      • 'Repository URL' — The location of subversion repository (svn://svn.forge.objectweb.org/svnroot/jonas/jonas/trunk/jonas).

      • 'Username' — (Optional)

      • 'Authentication Type' — Select 'Password'

      • 'Password — (Optional) , use the anonymous name access

  • 'Include/Exclude Files' — select 'None'

  • 'Web Repository URL' — (Optional) The plan's repository web URL.

  • 'Web Repository Module' — (Optional) The plan's repository name, if the above Web Repository URL points to multiple repositories.

  • 'Build Strategy' —select 'Poll the repository for changes', is a convenient option that requires no additional configuration. A number of other options are available; for details, please see 03. Triggering a Build. You can change the Build Strategy over time as required. The rest of the fields on this tab will vary depending on which Build Strategy you select.

  • 'Polling Frequency—'180', in seconds

Screenshot 3. 'Builder Configuration' :

3. 'Builder Configuration':

  • 'Builder' — Select 'Maven 2.0.6'. From the list of available Builders, select the one which Bamboo will use to build this plan.The following fields are maven builder:

    • Maven:

      • 'Goal' — 'clean install'. Specify the Maven goal you want Bamboo to execute each time the source code changes.

      • 'Build JDK' —1.5.0_10.

      • 'System Environment Variables' — (Optional)

      • 'Working Sub Directory'— (Optional)

  • 'Build JDK' —1.5.0_10.

  • 'System Environment Variables' — (Optional)

  • 'Web Repository Module' — (Optional) The plan's repository name, if the above Web Repository URL points to multiple repositories.

  • 'Working Sub Directory'— (Optional)

  • 'Where should Bamboo look for the test result files'— (Optional) .Select this check-box if you want Bamboo to gather test results data for each build result.

  • 'Where should Bamboo look for the Clover code-coverage output'— (Optional) . Select this check-box if you are running Cenqua Clover and want to view its code-coverage data from within Bamboo.

Screenshot 4. 'Build Artifacts' :

4. 'Build Artifacts':

  • Here you can specify the plan's artifacts. These can be any reports, websites, or JAR files that were created by the build process. Build artifacts are copied to a subdirectory (/PROJECT_NAME/download_data) under your 'Projects Data' folder, which you specified when installing Bamboo.

Screenshot 5. 'Build Notification' :

5. 'Build Notification':

  • Here you can specify who will receive notifications about this plan's build results, and under what circumstances. For details please see 6.1 Enabling or disabling Notifications for a Plan.

Screenshot 6. 'Post Action' :

6. 'Post Action':

  • 'Regex Pattern' — The regular expression for which to match the log files on. Labels will be applied to the build if the regular expression finds a match. You can leave this blank to label every build.

  • 'Labels' — Type the labels (if any) which you want to automatically apply to the plan's build results.

Click 'Save' button, Bamboo will begin to build according to 'Maven Build' plan:

2.2.2. How to create a 'Ant Build' Plan

To create a new plan for ' Ant Build' in a existing project 'JOnAS5'

1.Click the 'Create Plan' link in the top navigation bar.
2.On the 'Plan Details' screen, select the check-box 'Clone an existing build plan?'
3.A list called 'Plan to clone' will be displayed. Select the 'JOnAS5-Maven Build' plan you wish to copy.
4.Enter the required information in the 6 screens as described below. On screens 2-6, appropriate information will be copied from the plan you selected; but you will need to complete all fields on screen 1.
Screenshot 1. 'Plan Details':

Screenshot 2.'Source Repository': Refer to the screenshot of 'Maven Build' plan.

Screenshot 3. 'Builder Configuration' :

[Note]Note

: The target of build should be 'clean install -Djonas.root=${bamboo.jonas.root.50} -Dcatalina.home=${bamboo.catalina.home}'.

Screenshot 4. 'Build Artifacts' : Refer to the screenshot of 'Maven Build' plan.

Screenshot 5. 'Build Notification': Refer to the screenshot of 'Maven Build' plan.

Screenshot 6. 'Post Action' : Refer to the screenshot of 'Maven Build' plan.

2.2.3. How to create a 'Tests Build' Plan

To create a new plan for ' Tests Build':

1.Click the 'Create Plan' link in the top navigation bar.
2.Enter the required information in the 6 screens as described below. When you return to the Dashboard, your new plan (and new project, if applicable) will be displayed in the 'All Projects' list.

Screenshot 1. 'Plan Details' :

Screenshot 2.'Source Repository'

Screenshot 3. 'Builder Configuration' :

3. 'Builder Configuration' :

Builder' — Select 'Ant 1.6.5'. From the list of available Builders, select the one which Bamboo will use to build this plan.The following fields are ant builder:

  • Ant:

    • 'Build file' — 'build.xml'. Type the relevant filename.

    • 'Build JDK' —'1.5.0_10.

    • 'Target'—Specify the Ant target you want Bamboo to execute each time the source code change. For JOnAS, Type the target as below:

run_nightly  -Djonas.root=${bamboo.jonas.root.50} -Dhttpunit.home=${bamboo.http.unit} -Dhttp.port=9000 -Dxmlunit.home=${bamboo.xml.unit} -Dcatalina.home==${bamboo.catalina.home}
-Duser.home=<your_user_home>

Screenshot 4. 'Build Artifacts' :

Screenshot 5. 'Build Notification': Refer to the screenshot of 'Maven Build' plan.

Screenshot 6. 'Post Action' : Refer to the screenshot of 'Maven Build' plan.

2.2.4. How to define the relation of the three JOnAS Integration Activities

Chapter 3. Using Bamboo to manage the JOnAS integration work

3.1. Overview of the directory of Bamboo

3.2. Using the Dashboard

The Dashboard contains three tabs:

  • 'All Plans' — a list of build plans and each plan's latest build result.

  • 'Current Activity' — Bamboo's build queues, showing which plans Bamboo is currently building and which plans are waiting to be built.

  • 'My Bamboo' ¹ — a convenient summary of information that is relevant to you, It contains the information of your favorite build.

Screenshot 1. 'All Plans':

To view Bamboo's current activity,

Click the 'Home' link in the top navigation bar. This will display the Dashboard.
Click the 'Current Activity' tab. This will display Bamboo's Build Queues, as well as a list of Recently Completed Builds. 

Screenshot2: Bamboo Dashboard-'Current Activity' tab:

3.3. Viewing the Build result

Screenshot1: Build result-'Activity' tab:

Log-in Register
Copyright © ObjectWeb 2006
Java, and all Java-based trademarks, JMX and all JMX based trademarks, are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Bull is independent of Sun Microsystems, Inc..