Author: nickboldt
Date: 2010-10-01 22:37:42 -0400 (Fri, 01 Oct 2010)
New Revision: 25428
Added:
branches/jbosstools-3.2.0.Beta1/build/target-platform/build.xml
branches/jbosstools-3.2.0.Beta1/build/target-platform/getArch.sh
Modified:
branches/jbosstools-3.2.0.Beta1/build/parent/pom.xml
branches/jbosstools-3.2.0.Beta1/build/target-platform/README.txt
Log:
update docs (backport from trunk); add new build.xml and getArch.sh for building target
platform repo w/ ant
Modified: branches/jbosstools-3.2.0.Beta1/build/parent/pom.xml
===================================================================
--- branches/jbosstools-3.2.0.Beta1/build/parent/pom.xml 2010-10-02 02:33:46 UTC (rev
25427)
+++ branches/jbosstools-3.2.0.Beta1/build/parent/pom.xml 2010-10-02 02:37:42 UTC (rev
25428)
@@ -183,6 +183,7 @@
<repositories>
<repository>
<id>helios</id>
+ <!-- could also use
http://download.jboss.org/jbosstools/updates/target-platform/latest/ -->
<url>file://home/hudson/static_build_env/jbds/target-platform/e36-wtp322.target/</url>
<layout>p2</layout>
<snapshots>
Modified: branches/jbosstools-3.2.0.Beta1/build/target-platform/README.txt
===================================================================
--- branches/jbosstools-3.2.0.Beta1/build/target-platform/README.txt 2010-10-02 02:33:46
UTC (rev 25427)
+++ branches/jbosstools-3.2.0.Beta1/build/target-platform/README.txt 2010-10-02 02:37:42
UTC (rev 25428)
@@ -20,27 +20,39 @@
1. Zip the repo
- cd /tmp/REPO; zip -9r e361-wtp322.target.zip *
+ cd /tmp/REPO; zip -9r e361-wtp322.target.zip * &
2. Push to qa01
- rsync e361-wtp322.target.zip nboldt@qa01:~/
+ rsync -aPrz e361-wtp322.target.zip nboldt@qa01:~/ &
3. Ssh to qa01; sudo to hudson; unpack and push contents + zip to
download.jboss.org
sudo su - hudson
- unzip /home/nboldt/e361-wtp322.target.zip -d /tmp/e361-wtp322.target
- rsync -aPrz --rsh=ssh /tmp/e361-wtp322.target/* \
- tools@filemgmt.jboss.org:/downloads_htdocs/tools/updates/target-platform/latest/
+ unzip /home/nboldt/e361-wtp322.target.zip -d /tmp/e361-wtp322.target &
+ rsync -aPrz --delete --rsh=ssh /tmp/e361-wtp322.target/* \
+ tools@filemgmt.jboss.org:/downloads_htdocs/tools/updates/target-platform/latest/ &
rsync -aPrz --rsh=ssh /home/nboldt/e361-wtp322.target.zip \
- tools@filemgmt.jboss.org:/downloads_htdocs/tools/updates/target-platform
+ tools@filemgmt.jboss.org:/downloads_htdocs/tools/updates/target-platform &
+== HOWTO: Publish local p2 repo (generated from .target) to shared location in Hudson for
use in builds ==
+
+1. You can reference
http://download.jboss.org/jbosstools/updates/target-platform/latest/,
+ but a local path reference is faster.
+
+2. So, continuing from previous HOWTO, copy from /tmp/e361-wtp322.target into
+ file://home/hudson/static_build_env/jbds/target-platform/e36-wtp322.target/
+
+ rsync -aPrz --delete /tmp/e361-wtp322.target/* \
+ /home/hudson/static_build_env/jbds/target-platform/e36-wtp322.target/ &
+
+
== HOWTO: Update an existing .target file from newer versions of IUs in a repo ==
1. Run targetUpdateFromRepo.xml against a given repo folder on disk, eg.
-ant -v -f targetUpdateFromRepo.xml -DtargetFile=e361-wtp322.target -DrepoDir=./REPO_SR1
+ ant -v -f targetUpdateFromRepo.xml -DtargetFile=e361-wtp322.target -DrepoDir=./REPO_SR1
2. Resulting targetFile will be overwritten with updated version values from what was
found in the
repo's content.xml file.
Added: branches/jbosstools-3.2.0.Beta1/build/target-platform/build.xml
===================================================================
--- branches/jbosstools-3.2.0.Beta1/build/target-platform/build.xml
(rev 0)
+++ branches/jbosstools-3.2.0.Beta1/build/target-platform/build.xml 2010-10-02 02:37:42
UTC (rev 25428)
@@ -0,0 +1,109 @@
+<project default="custom.hudson.build" name="jbosstools target platform
p2.mirror generator - ant script for Hudson">
+ <property name="targetFile" value="e361-wtp322.target" />
+
+ <!-- if useLatest = true, omit versions from p2.mirror script to fetch latest version
available;
+ if useLatest = false, include versions and fetch specific versions requested. -->
+ <property name="useLatest" value="true" />
+
+ <property name="tmpdir"
value="${java.io.tmpdir}/target-platform-build" />
+
+ <condition property="WORKINGDIR"
value="/home/hudson/static_build_env/jbds/tools/sources"
else="${basedir}">
+ <available file="/home/hudson/static_build_env/jbds" type="dir"
/>
+ </condition>
+ <mkdir dir="${WORKINGDIR}" />
+
+ <condition property="COMMON_TOOLS"
value="/home/hudson/static_build_env/jbds/tools"
else="${java.io.tmpdir}">
+ <available file="/home/hudson/static_build_env/jbds" type="dir"
/>
+ </condition>
+ <mkdir dir="${COMMON_TOOLS}" />
+
+ <condition property="build.xml"
value="/home/hudson/static_build_env/jbds/tools/sources/build/build.xml">
+ <available
file="/home/hudson/static_build_env/jbds/tools/sources/build/build.xml"
type="file" />
+ </condition>
+ <condition property="build.xml"
value="${basedir}/../../build/build.xml">
+ <available file="${basedir}/../../build/build.xml" type="file"
/>
+ </condition>
+ <condition property="build.xml"
value="${basedir}/../../build.xml">
+ <available file="${basedir}/../../build.xml" type="file" />
+ </condition>
+ <condition property="build.xml"
value="${basedir}/../../sources/build.xml">
+ <available file="${basedir}/../../sources/build.xml" type="file"
/>
+ </condition>
+ <condition property="build.xml"
value="${basedir}/../build.xml">
+ <available file="${basedir}/../build.xml" type="file" />
+ </condition>
+ <!-- if can't calculate where build/build.xml is located, must pass in path from
parent when calling this script -->
+
+ <target name="custom.hudson.build" depends="init, get.arch,
get.eclipse, gen.p2mirror.script, run.p2mirror.script, cleanup" />
+
+ <target name="init">
+ <ant antfile="${build.xml}" target="init" />
+ <taskdef resource="net/sf/antcontrib/antlib.xml">
+ <classpath>
+ <pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
+ </classpath>
+ </taskdef>
+ </target>
+
+ <target name="get.arch">
+ <if>
+ <os family="unix" />
+ <then>
+ <!-- Ant thinks that ${os.arch} == i386 for ${arch}, so use `uname` instead
-->
+ <exec executable="bash" outputproperty="arch">
+ <arg line="getArch.sh" />
+ </exec>
+ </then>
+ <else>
+ <echo level="error">This script is only tested to work on Linux 32-
and 64-bit Hudson slaves.</echo>
+ <condition property="arch" value="${arch}"
else="">
+ <os arch="amd64" />
+ </condition>
+ </else>
+ </if>
+ </target>
+
+ <!-- only meant to work with linux 32- and 64-bit slaves -->
+ <target name="get.eclipse">
+ <property name="eclipse.URL"
value="http://www.eclipse.org/downloads/download.php?r=1&fil...
/>
+ <property name="eclipse.version" value="eclipse-SDK-3.6.1"
/>
+ <if>
+ <equals arg1="${arch}" arg2="x86" />
+ <then>
+ <property name="eclipse.file"
value="${eclipse.version}-linux-gtk.tar.gz" />
+ </then>
+ <else>
+ <property name="eclipse.file"
value="${eclipse.version}-linux-gtk-${arch}.tar.gz" />
+ </else>
+ </if>
+
+ <if>
+ <not>
+ <available file="${WORKINGDIR}/${eclipse.file}" type="file"
/>
+ </not>
+ <then>
+ <get src="${eclipse.URL}/${eclipse.file}"
dest="${WORKINGDIR}/${eclipse.file}" />
+ </then>
+ </if>
+ <untar compression="gzip" dest="${WORKINGDIR}"
src="${WORKINGDIR}/${eclipse.file}" overwrite="true" />
+ <chmod perm="+x" file="${WORKINGDIR}/eclipse/eclipse" />
+ </target>
+
+ <target name="gen.p2mirror.script" description="use XSLT to generate a
p2.mirror script from .target">
+ <ant antfile="target2p2mirror.xml" />
+ </target>
+
+ <!-- /abs/path/to/eclipse -vm /opt/jdk1.6.0/bin/java -nosplash -data /tmp/workspace
-consolelog -application
+ org.eclipse.ant.core.antRunner -f *.target.p2mirror.xml -Ddebug=true
-DfollowStrict=true -Drepo.dir=/tmp/REPO/ -->
+ <target name="run.p2mirror.script" description="build target update
site using p2.mirror">
+ <exec executable="${WORKINGDIR}/eclipse/eclipse"
dir="${basedir}">
+ <arg line=" -nosplash -data ${tmpdir}/workspace -consolelog -application
org.eclipse.ant.core.antRunner" />
+ <arg line=" -f ${targetFile}.p2mirror.xml -DfollowStrict=true
-Drepo.dir=${WORKINGDIR}/REPO/" />
+ <arg line=" -Ddebug=true" />
+ </exec>
+ </target>
+
+ <target name="cleanup">
+ <delete dir="${tmpdir}" quiet="true"
includeemptydirs="true" />
+ </target>
+</project>
Added: branches/jbosstools-3.2.0.Beta1/build/target-platform/getArch.sh
===================================================================
--- branches/jbosstools-3.2.0.Beta1/build/target-platform/getArch.sh
(rev 0)
+++ branches/jbosstools-3.2.0.Beta1/build/target-platform/getArch.sh 2010-10-02 02:37:42
UTC (rev 25428)
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+if uname -m > /dev/null 2>&1; then
+ arch=`uname -m`
+else
+ arch=`uname -p`
+fi
+# Massage arch for Eclipse-uname differences
+case $arch in
+ i[0-9]*86)
+ arch=x86 ;;
+ ia64)
+ arch=ia64 ;;
+ ppc)
+ arch=ppc ;;
+ ppc64)
+ arch=ppc ;;
+ x86_64)
+ arch=x86_64 ;;
+ *)
+ echo "ERROR: Unrecognized architecture: $arch"
+ exit 1 ;;
+esac
+echo $arch
\ No newline at end of file
Property changes on: branches/jbosstools-3.2.0.Beta1/build/target-platform/getArch.sh
___________________________________________________________________
Name: svn:executable
+ *