Skip to content

Commit

Permalink
Merge branch 'hudson'
Browse files Browse the repository at this point in the history
  • Loading branch information
tdiesler committed Apr 26, 2010
2 parents 618429f + b284c35 commit 3bd1064
Show file tree
Hide file tree
Showing 42 changed files with 1,010 additions and 1,110 deletions.
9 changes: 9 additions & 0 deletions .settings/org.maven.ide.eclipse.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Fri Apr 23 20:26:27 CEST 2010
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false
resolveWorkspaceProjects=true
resourceFilterGoals=process-resources resources\:testResources
skipCompilerPlugin=true
version=1
2 changes: 2 additions & 0 deletions hudson/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/ant.properties
43 changes: 23 additions & 20 deletions hudson/ant.properties.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,40 @@
#
# $Id: ant.properties.example 3995 2007-07-26 08:52:45Z thomas.diesler@jboss.com $

# Hudson Workspace Root
# hudson.root=/home/username/workspace/hudson/jboss-osgi
# Tomcat settings
tomcat.base=/usr/share/tomcat6
tomcat.conf=/etc/tomcat6/tomcat6.conf

# Hudson QA Environment
# hudson.username=username
# SCM settings
# ------------
scm.git.url.jbosgi=git://github.com/jbosgi/jbosgi.git
scm.http.url.jbosgi=http://github.com/jbosgi/jbosgi

#hudson.jboss501.zip=file:///home/username/Download/java/jboss/jboss-5.0.1.GA.zip
#hudson.jboss510.zip=file:///home/username/Download/java/jboss/jboss-5.1.0.GA.zip
#hudson.jboss600.zip=file:///home/username/Download/java/jboss/jboss-6.0.0.M1.zip
# The Hudson OSGi TCK checkout URL
osgitck.svn.url=https://www.osgi.org/members/svn/build/trunk
osgitck.core.svn.url=https://www.osgi.org/members/svn/build/tags/r4v42-core-cmpn-final

# JDK settings
# ------------
java.home.jdk15=/usr/java/jdk1.5.0_22
java.home.jdk16=/usr/java/jdk1.6.0_17

# Maven settings
hudson.maven.name=apache-maven-2.2.1
hudson.maven.path=/usr/java/apache-maven-2.2.1
hudson.maven.profile=$HUDSONDIR/profiles.xml.local.qa
# --------------
maven.name=apache-maven-2.2.1
maven.path=/usr/java/apache-maven-2.2.1

# The JBoss settings
# ------------------
jboss.server.instance=default
jboss.bind.address=127.0.0.1

hudson.host=localhost
hudson.admin.port=8250
hudson.http.port=8280

hudson.mail.recipients=
hudson.mail.admin=yourname@yourdomain.com
hudson.smtp.host=localhost

apache-tomcat=5.5.27
sun-hudson=1.336
# Hudson Default settings
# -----------------------
# hudson.root=/home/username/workspace/hudson/jboss-osgi
# hudson.admin=username
# hudson.version=1.355

# hudson.jboss501.zip=file:///home/username/Download/java/jboss/jboss-5.0.1.GA.zip
# hudson.jboss510.zip=file:///home/username/Download/java/jboss/jboss-5.1.0.GA.zip
# hudson.jboss600.zip=file:///home/username/Download/java/jboss/jboss-6.0.0.M2.zip
44 changes: 0 additions & 44 deletions hudson/apache-tomcat/conf/server.xml

This file was deleted.

142 changes: 43 additions & 99 deletions hudson/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,6 @@
<property name="hudson.target.dir" value="${hudson.dir}/target"/>
<property name="project.root.dir" value="${basedir}/.."/>

<!-- ================================================================== -->
<!-- Hudson Jobs -->
<!-- ================================================================== -->
<macrodef name="copyjobs">
<sequential>
<copy todir="${hudson.home}/jobs" overwrite="true">
<fileset dir="${hudson.dir}/hudson-home/jobs">
<include name="*/config.xml"/>
</fileset>
<filterset>
<filter token="hudson.osgi.url" value="${hudson.osgi.url}"/>
<filter token="version.id" value="${version.id}"/>
<filtersfile file="${hudson.dir}/ant.properties"/>
</filterset>
</copy>
</sequential>
</macrodef>

<!-- ================================================================== -->
<!-- Initialization -->
<!-- ================================================================== -->
Expand All @@ -49,37 +31,40 @@

<!-- Setup property defaults -->
<property environment="env"/>
<property name="hudson.username" value="${env.USER}" />
<property name="hudson.root" value="/home/${hudson.username}/workspace/jboss-osgi" />
<property name="hudson.admin" value="${env.USER}" />
<property name="hudson.root" value="/home/${hudson.admin}/workspace/jboss-osgi" />

<xmlproperty file="${project.root.dir}/pom.xml"/>
<property name="version.id" value="${project.version}"/>
</target>

<target name="init-hudson" depends="init">
<property name="hudson.tomcat" value="${hudson.root}/apache-tomcat"/>
<property name="hudson.home" value="${hudson.root}/hudson-home"/>
<property name="hudson.jboss" value="${hudson.root}/jboss"/>
<property name="hudson.version" value="1.355"/>

<echo/>
<echo message="hudson.user = ${hudson.username}"/>
<echo message="hudson.user = ${hudson.admin}"/>
<echo message="hudson.root = ${hudson.root}"/>
<echo message="hudson.home = ${hudson.home}"/>
<echo/>

<available file="${hudson.root}" property="hudson.root.available"/>
<available file="${hudson.tomcat}" property="hudson.tomcat.available"/>
<fail message="Hudson root not available: ${hudson.root}" unless="hudson.root.available"/>
<available file="${tomcat.base}" property="tomcat.base.available"/>
<fail message="Tomcat base not available: ${tomcat.base}" unless="tomcat.base.available"/>
<available file="${tomcat.conf}" property="tomcat.conf.available"/>
<fail message="Tomcat conf not available: ${tomcat.conf}" unless="tomcat.conf.available"/>

<property name="hudson.username.${hudson.username}" value="true"/>
<fail message="Cannot use default hudson username: ${hudson.username}" if="hudson.username.changeme"/>
<property name="hudson.admin.${hudson.admin}" value="true"/>
<fail message="Cannot use default hudson username: ${hudson.admin}" if="hudson.admin.changeme"/>
</target>

<target name="init-thirdparty" depends="init-hudson">
<property name="thirdparty.dir" value="${hudson.target.dir}/thirdparty"/>
<mkdir dir="${thirdparty.dir}"/>
<available property="apache.tomcat.available" file="${thirdparty.dir}/apache-tomcat.zip"/>
<available property="sun.hudson.available" file="${thirdparty.dir}/hudson.war"/>
<available property="hudson.war.available" file="${thirdparty.dir}/hudson.war"/>
<available property="jboss501.available" file="${thirdparty.dir}/jboss-5.0.1.GA.zip"/>
<available property="jboss510.available" file="${thirdparty.dir}/jboss-5.1.0.GA.zip"/>
<available property="jboss600.available" file="${thirdparty.dir}/jboss-6.0.0.M2.zip"/>
Expand All @@ -88,16 +73,13 @@
<!--
Get thirdparty dependencies
-->
<target name="thirdparty" depends="init-thirdparty,get-tomcat,get-hudson,get-jboss501,get-jboss510,get-jboss600">
<target name="thirdparty" depends="init-thirdparty,get-hudson,get-jboss501,get-jboss510,get-jboss600">
<copy todir="${hudson.root}/jboss" file="${thirdparty.dir}/jboss-5.0.1.GA.zip"/>
<copy todir="${hudson.root}/jboss" file="${thirdparty.dir}/jboss-5.1.0.GA.zip"/>
<copy todir="${hudson.root}/jboss" file="${thirdparty.dir}/jboss-6.0.0.M2.zip"/>
</target>
<target name="get-tomcat" depends="init-thirdparty" unless="apache.tomcat.available">
<get src="http://www.apache.org/dist/tomcat/tomcat-5/v${apache-tomcat}/bin/apache-tomcat-${apache-tomcat}.zip" dest="${thirdparty.dir}/apache-tomcat.zip" usetimestamp="true" verbose="true"/>
</target>
<target name="get-hudson" depends="init-thirdparty" unless="sun.hudson.available">
<get src="http://hudson-ci.org/download/war/${sun-hudson}/hudson.war" dest="${thirdparty.dir}/hudson.war" usetimestamp="true" verbose="true"/>
<target name="get-hudson" depends="init-thirdparty" unless="hudson.war.available">
<get src="http://hudson-ci.org/download/war/${hudson.version}/hudson.war" dest="${thirdparty.dir}/hudson.war" usetimestamp="true" verbose="true"/>
</target>
<target name="get-jboss501" depends="init-thirdparty" unless="jboss501.available">
<property name="hudson.jboss501.zip" value="http://downloads.sourceforge.net/jboss/jboss-5.0.1.GA.zip"/>
Expand All @@ -115,63 +97,41 @@
<!--
Setup the Hudson Tomcat instance
-->
<target name="hudson-tomcat-setup" depends="thirdparty" unless="hudson.tomcat.available">
<target name="hudson-tomcat-setup" depends="thirdparty">

<!-- Install Tomcat -->
<unzip src="${thirdparty.dir}/apache-tomcat.zip" dest="${hudson.root}"/>
<move file="${hudson.root}/apache-tomcat-${apache-tomcat}" tofile="${hudson.tomcat}"/>
<chmod perm="+x">
<fileset dir="${hudson.tomcat}/bin">
<include name="*.sh"/>
</fileset>
</chmod>
<property file="${tomcat.conf}"/>
<fail unless="HUDSON_HOME">
HUDSON_HOME not available in: ${tomcat.conf}
echo 'HUDSON_HOME=${hudson.home}' >> ${tomcat.conf}
</fail>

<!-- Install Hudson -->
<copy todir="${hudson.tomcat}/webapps" file="${thirdparty.dir}/hudson.war"/>
<copy todir="${tomcat.base}/webapps" file="${thirdparty.dir}/hudson.war"/>

</target>

<!--
Update the Hudson version
-->
<target name="hudson-update" depends="init-thirdparty">
<get src="https://hudson.dev.java.net/files/documents/${sun-hudson}/hudson.war" dest="${thirdparty.dir}/hudson.war" usetimestamp="false" verbose="true"/>
<delete dir="${hudson.tomcat}/webapps/hudson"/>
<copy todir="${hudson.tomcat}/webapps" file="${thirdparty.dir}/hudson.war" overwrite="true"/>
<get src="http://hudson-ci.org/download/war/${hudson.version}/hudson.war" dest="${thirdparty.dir}/hudson.war" usetimestamp="false" verbose="true"/>
<delete dir="${tomcat.base}/webapps/hudson"/>
<copy todir="${tomcat.base}/webapps" file="${thirdparty.dir}/hudson.war" overwrite="true"/>
</target>

<!--
Setup the Hudson QA environment
-->
<target name="hudson-setup" depends="init-hudson,hudson-tomcat-setup" description="Setup the Hudson QA environment">

<!-- get the svn url -->
<exec dir="${project.root.dir}" executable="svn" failonerror="true" output="${hudson.target.dir}/svn-info.xml">
<arg line="info"/>
<arg line="--xml"/>
</exec>
<xmlproperty file="${hudson.target.dir}/svn-info.xml"/>
<property name="hudson.osgi.url" value="${info.entry.url}"/>

<!-- Configure Tomcat -->
<copy todir="${hudson.tomcat}" overwrite="true">
<fileset dir="${hudson.dir}/apache-tomcat">
<include name="**/*.xml"/>
</fileset>
<filterset>
<filtersfile file="${hudson.dir}/ant.properties"/>
<filter token="hudson.home" value="${hudson.home}"/>
</filterset>
</copy>

<!-- Configure Hudson Home -->
<copy todir="${hudson.home}" overwrite="true">
<fileset dir="${hudson.dir}/hudson-home">
<include name="*.xml"/>
</fileset>
<filterset>
<filter token="version.id" value="${version.id}"/>
<filter token="hudson.username" value="${hudson.username}"/>
<filter token="hudson.admin" value="${hudson.admin}"/>
<filtersfile file="${hudson.dir}/ant.properties"/>
</filterset>
</copy>
Expand All @@ -182,44 +142,28 @@
<echo/>
<echo message="*************************************"/>
<echo message="* Hudson setup successfully "/>
<echo message="* ant hudson-start "/>
<echo message="*************************************"/>
<echo/>

</target>

<target name="hudson-stop" depends="init-hudson" description="Stops the Hudson QA environment">

<exec executable="${hudson.tomcat}/bin/catalina.sh" failonerror="true">
<arg line="stop"/>
</exec>

<echo/>
<echo message="*************************************"/>
<echo message="* Hudson stopped successfully "/>
<echo message="* ant hudson-start "/>
<echo message="* sudo service tomcat6 restart "/>
<echo message="*************************************"/>
<echo/>

</target>

<target name="hudson-start" depends="init-hudson" description="Start the Hudson QA environment">

<property environment="env"/>
<fail message="unset JBOSS_REPOSITORY=${env.JBOSS_REPOSITORY}" if="env.JBOSS_REPOSITORY"/>

<exec executable="${hudson.tomcat}/bin/catalina.sh" failonerror="true" output="${hudson.target.dir}/hudson.log">
<env key="CATALINA_OPTS" value="-Xmx512m -DHUDSON_HOME=${hudson.home} -Djava.awt.headless=true"/>
<arg line="start"/>
</exec>

<echo/>
<echo message="*************************************"/>
<echo message="* Hudson started successfully "/>
<echo message="* http://${jboss.bind.address}:${hudson.http.port}/hudson"/>
<echo message="*************************************"/>
<echo/>

</target>
<!-- ================================================================== -->
<!-- Hudson Jobs -->
<!-- ================================================================== -->
<macrodef name="copyjobs">
<sequential>
<copy todir="${hudson.home}/jobs" overwrite="true">
<fileset dir="${hudson.dir}/hudson-home/jobs">
<include name="*/config.xml"/>
</fileset>
<filterset>
<filter token="scm.git.url.jbosgi" value="${scm.git.url.jbosgi}"/>
<filter token="version.id" value="${version.id}"/>
<filtersfile file="${hudson.dir}/ant.properties"/>
</filterset>
</copy>
</sequential>
</macrodef>

</project>

0 comments on commit 3bd1064

Please sign in to comment.