Author: nickboldt
Date: 2010-07-20 00:25:50 -0400 (Tue, 20 Jul 2010)
New Revision: 23573
Modified:
branches/jbosstools-3.2.0.M1/build/publish.sh
branches/jbosstools-3.2.0.M1/build/results/build.xml
Log:
port from trunk
Modified: branches/jbosstools-3.2.0.M1/build/publish.sh
===================================================================
--- branches/jbosstools-3.2.0.M1/build/publish.sh 2010-07-19 22:06:20 UTC (rev 23572)
+++ branches/jbosstools-3.2.0.M1/build/publish.sh 2010-07-20 04:25:50 UTC (rev 23573)
@@ -102,6 +102,9 @@
if [[ ${RELEASE} == "Yes" ]]; then
mkdir -p ${STAGINGDIR}/logs
ANT_PARAMS="-v -DZIPSUFFIX=${ZIPSUFFIX} -DJOB_NAME=${JOB_NAME}
-Dinput.dir=${STAGINGDIR} -Doutput.dir=${STAGINGDIR}/logs -DWORKSPACE=${WORKSPACE}"
+ if [[ ${JOB_NAME/.aggregate} != ${JOB_NAME} ]]; then # reuse snippet from upstream
build
+ ANT_PARAMS="${ANT_PARAMS}
-Dtemplate.file=http://download.jboss.org/jbosstools/builds/nightly/3.2.helios/${JOB_NAME/.aggregate/.continuous}/logs/download-snippet.txt"
+ fi
for buildxml in ${WORKSPACE}/build/results/build.xml
${WORKSPACE}/sources/build/results/build.xml ${WORKSPACE}/sources/results/build.xml; do
if [[ -f ${buildxml} ]]; then
ANT_SCRIPT=${buildxml}
@@ -136,14 +139,13 @@
# publish to
download.jboss.org, unless errors found - avoid destroying last-good update
site
if [[ $ec == "0" ]] && [[ $fc == "0" ]]; then
- # publish update site dir
+ # publish build dir (including update sites/zips/logs/metadata
if [[ -d ${STAGINGDIR} ]]; then
- date; rsync -arzq --delete ${STAGINGDIR} $DESTINATION/builds/nightly/3.2.helios/
+ date; rsync -arzq --delete ${STAGINGDIR} $DESTINATION/builds/nightly/3.2.helios/; #
create a new unique dir
+ if [[ ${RELEASE} == "Yes" ]]; then
+ date; rsync -arzq --delete ${STAGINGDIR}/*
$DESTINATION/builds/nightly/3.2.helios/${JOB_NAME}/ # update existing snapshot dir
+ fi
fi
- # publish update site zip
- if [[ -f ${WORKSPACE}/results/${SNAPNAME} ]]; then
- date; rsync -arzq --delete ${WORKSPACE}/results/${SNAPNAME}
$DESTINATION/builds/nightly/3.2.helios/
- fi
# extra publish step for aggregate update sites ONLY
if [[ ${JOB_NAME/.aggregate} != ${JOB_NAME} ]]; then
Modified: branches/jbosstools-3.2.0.M1/build/results/build.xml
===================================================================
--- branches/jbosstools-3.2.0.M1/build/results/build.xml 2010-07-19 22:06:20 UTC (rev
23572)
+++ branches/jbosstools-3.2.0.M1/build/results/build.xml 2010-07-20 04:25:50 UTC (rev
23573)
@@ -6,6 +6,9 @@
<!-- should be set by Hudson -->
<!-- <property name="JOB_NAME"
value="jbosstools-3.2.0.M2.continuous" /> -->
+ <!-- if a different template file (eg., a partially expanded one) should be used,
feed it in here -->
+ <property name="template.file" value="download-template.xml"
/>
+
<!-- if ${WORKSPACE}/site folder exists, target that folder; else generate here.
-->
<condition property="output.dir" value="${WORKSPACE}/results"
else="${basedir}">
<available file="${WORKSPACE}/results" />
@@ -89,7 +92,7 @@
<target name="build.results" depends="init">
<!--
1. resolve variables in download-template.xml to produce download.xml
- 2. XSL transform download.xml to produce download.snippet.txt
+ 2. XSL transform download.xml to produce download-snippet.txt
3. manually copy the contents of this file into a page under
http://www.jboss.org/tools/downloads/
-->
@@ -129,13 +132,23 @@
</and>
<then>
<if>
- <equals arg1="${filename}"
arg2="${JOB_NAME}-Sources-${ZIPSUFFIX}.zip" />
+ <!-- only set the update variable if it's NOT coming from the aggregate
build -->
+ <and>
+ <equals arg1="${filename}"
arg2="${JOB_NAME}-Sources-${ZIPSUFFIX}.zip" />
+ <not>
+ <contains string="${JOB_NAME}" substring="aggregate"
/>
+ </not>
+ </and>
<then>
<var name="COMPONENT" unset="true" />
<var name="COMPONENT" value="sources" />
</then>
<elseif>
- <equals arg1="${filename}"
arg2="${JOB_NAME}-Update-${ZIPSUFFIX}.zip" />
+ <!-- only set the update variable if it's coming from the aggregate build;
others should be ignored -->
+ <and>
+ <equals arg1="${filename}"
arg2="${JOB_NAME}-Update-${ZIPSUFFIX}.zip" />
+ <contains string="${JOB_NAME}" substring="aggregate"
/>
+ </and>
<then>
<var name="COMPONENT" unset="true" />
<var name="COMPONENT" value="update" />
@@ -159,15 +172,67 @@
</sequential>
</for>
- <copy todir="${output.dir}" overwrite="true">
- <fileset file="download-template.xml" />
- <mapper type="merge" to="download.xml" />
- <filterchain>
- <expandproperties />
- </filterchain>
- </copy>
- <xslt in="${output.dir}/download.xml"
out="${output.dir}/download-snippet.txt" style="download.xsl" />
- <delete file="${output.dir}/download.xml" />
+ <if>
+ <!-- default operation from template file -->
+ <equals arg1="${template.file}" arg2="download-template.xml"
/>
+ <then>
+ <copy todir="${output.dir}" overwrite="true">
+ <fileset file="${template.file}" />
+ <mapper type="merge" to="download.xml" />
+ <filterchain>
+ <expandproperties />
+ </filterchain>
+ </copy>
+ <xslt in="${output.dir}/download.xml"
out="${output.dir}/download-snippet.txt" style="download.xsl" />
+ <delete file="${output.dir}/download.xml" />
+ </then>
+ <elseif>
+ <!-- use previously XLST'd file from an upstream build -->
+ <or>
+ <contains string="${template.file}" substring="http:" />
+ <contains string="${template.file}" substring="https:" />
+ <contains string="${template.file}" substring="ftp:" />
+ </or>
+ <then>
+ <propertyregex property="template.file.cleaned"
+ input="${template.file}"
+ defaultvalue="${template.file}"
+ regexp=".+/([^/]+)"
+ replace="\1"
+ override="true" />
+ <get src="${template.file}"
dest="${output.dir}/${template.file.cleaned}.in" ignoreerrors="true"
/>
+ <if>
+ <available file="${output.dir}/${template.file.cleaned}.in"
type="file" />
+ <then>
+ <!-- use pre-existing snippet file -->
+ <copy todir="${output.dir}" overwrite="true">
+ <fileset file="${template.file.cleaned}.in" />
+ <mapper type="merge" to="download-snippet.txt" />
+ <filterchain>
+ <expandproperties />
+ </filterchain>
+ </copy>
+ <delete file="${output.dir}/${template.file.cleaned}.in"
quiet="true" />
+ </then>
+ <else>
+ <!-- fall back to default template file -->
+ <var name="template.file" value="download-template.xml"
/>
+ <copy todir="${output.dir}" overwrite="true">
+ <fileset file="${template.file}" />
+ <mapper type="merge" to="download.xml" />
+ <filterchain>
+ <expandproperties />
+ </filterchain>
+ </copy>
+ <xslt in="${output.dir}/download.xml"
+ out="${output.dir}/download-snippet.txt"
+ style="download.xsl" />
+ <delete file="${output.dir}/download.xml" />
+ </else>
+ </if>
+ </then>
+ </elseif>
+ </if>
</target>
</project>