This is a guide to creating a new jBPM 3 container job in Hudson. For illustration purposes the new target container will be JBoss 5.1.0.
Register Container as Installation Choice
<variables> <variable name="jboss510.home" value="@{jboss510.home}" /> </variables> <dynamicvariables> <variable name="jboss.home" value="${jboss510.home}" condition="isJBoss510" /> </dynamicvariables> <conditions> <!-- Target Server Conditions --> <condition type="variable" id="isJBoss510"> <name>jbossSelection</name> <value>jboss510</value> </condition> </conditions> <pack name="jBPM3 JBoss Integration" required="no" preselected="yes"> <!-- jbpm-jbm-service --> <file src="@{resources.directory}/destination/jbpm-jbm-service.xml" targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deploy/jbpm" condition="isJBoss510" /> </pack>
<panel order="0"> <field type="radio" variable="jbossSelection"> <description align="left" id="jboss.selection" /> <spec> <choice txt="JBoss 5.1.0" value="jboss510" set="true"/> </spec> </field> </panel>
Add Container Job
Add the container to the ant script that builds a local Hudson instance.
<target name="init-thirdparty" depends="init-hudson"> <available property="jboss510.available" file="${thirdparty.dir}/jboss-5.1.0.GA.zip" /> </target> <target name="thirdparty" depends="init-thirdparty,get-tomcat,get-hudson,get-jboss405,get-jboss423,get-jboss501,get-jboss-510"> <copy todir="${hudson.base}/jboss" file="${thirdparty.dir}/jboss-5.1.0.GA.zip" /> </target> <target name="get-jboss510" depends="init-thirdparty" unless="jboss510.available"> <property name="hudson.jboss510.zip" value="http://downloads.sourceforge.net/jboss/jboss-5.1.0.GA-jdk6.zip" /> <get src="${hudson.jboss510.zip}" dest="${thirdparty.dir}/jboss-5.1.0.GA.zip" usetimestamp="true" verbose="true" /> </target>
List the container archive in the example ant properties file.
#hudson.jboss510.zip=file:/home/hudson/download/java/jboss/jboss-5.1.0.GA-jdk6.zip
Add the container to the shell script that runs the test suite from within Hudson.
case "$CONTAINER" in jboss510*) JBOSS_BUILD=jboss-5.1.0.GA ;; esac
Create the container job config.xml in hudson/hudson-home/jobs/jbpm3-jboss510
<matrix-project> <actions class="java.util.concurrent.CopyOnWriteArrayList"/> <description>Build and test jBPM 3 on JBoss 5.1.0</description> <logRotator> <daysToKeep>60</daysToKeep> <numToKeep>-1</numToKeep> </logRotator> <keepDependencies>false</keepDependencies> <properties> <hudson.security.AuthorizationMatrixProperty/> </properties> <scm class="hudson.scm.SubversionSCM"> <locations> <hudson.scm.SubversionSCM_-ModuleLocation> <remote>@hudson.jbpm.url@</remote> <local>jbpm</local> </hudson.scm.SubversionSCM_-ModuleLocation> </locations> <useUpdate>true</useUpdate> <browser class="hudson.scm.browsers.FishEyeSVN"> <url>http://fisheye.jboss.com/browse/JbpmSvn/</url> <rootModule></rootModule> </browser> </scm> <canRoam>true</canRoam> <disabled>false</disabled> <triggers class="vector"/> <axes> <axis> <name>database</name> <values> <string>db2</string> <string>hsqldb</string> <string>mysql</string> <string>oracle</string> <string>postgresql</string> <string>sybase</string> </values> </axis> </axes> <builders> <hudson.tasks.Shell> <command><![CDATA[ export CONTAINER=jboss510 export DATABASE=$database export HUDSON_BASE=@hudson.base@ export JBOSS_SERVER=@jboss.server.instance@ export JBOSS_BINDADDR=@jboss.bind.address@ # call continuous integration script sh jbpm/hudson/hudson-home/command.sh ]]></command> </hudson.tasks.Shell> </builders> <publishers class="vector"> <hudson.tasks.junit.JUnitResultArchiver> <testResults>jbpm/modules/**/target/surefire-reports/TEST-*.xml</testResults> </hudson.tasks.junit.JUnitResultArchiver> <hudson.tasks.Mailer> <recipients>@hudson.mail.recipients@</recipients> <dontNotifyEveryUnstableBuild>false</dontNotifyEveryUnstableBuild> <sendToIndividuals>true</sendToIndividuals> </hudson.tasks.Mailer> </publishers> <buildWrappers/> </matrix-project>
Link the new container job to an existing one.
<publishers class="vector"> <hudson.tasks.BuildTrigger> <childProjects>jbpm3-jboss510</childProjects> <threshold> <name>SUCCESS</name> <ordinal>0</ordinal> <color>BLUE</color> </threshold> </hudson.tasks.BuildTrigger> </publishers>
Make Enterprise Tests Aware of Container
ContainerProvidedJarsTest requires a text file that lists the libraries the container must provide. To generate the dependencies file, run the following command in the container directory. Put jboss510-dependencies.txt in modules/enterprise/src/test/resources.
(ls -1 lib; ls -1 lib/endorsed; ls -1 server/default/lib/) | grep jar | sed s/.jar// | sort -u
IntegrationTestHelper has logic to determine the container version. Check for the new container.
public String getIntegrationTarget() { if (jbossVersion.startsWith("5.1.0")) integrationTarget = "jboss510"; }
Comments