[jbosstools-commits] JBoss Tools SVN: r23409 - in trunk/build: results and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Jul 14 18:30:14 EDT 2010


Author: nickboldt
Date: 2010-07-14 18:30:14 -0400 (Wed, 14 Jul 2010)
New Revision: 23409

Modified:
   trunk/build/publish.sh
   trunk/build/results/build.xml
Log:
reorg the results so that update site is in repo/ dir

Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh	2010-07-14 20:43:38 UTC (rev 23408)
+++ trunk/build/publish.sh	2010-07-14 22:30:14 UTC (rev 23409)
@@ -18,8 +18,11 @@
 
 if [[ $DESTINATION == "" ]]; then DESTINATION="tools at filemgmt.jboss.org:/downloads_htdocs/tools/builds/nightly/3.2.helios"; fi
 
+# where to create the stuff to publish
+STAGINGDIR=${WORKSPACE}/results/${JOB_NAME}
+
 # cleanup from last time
-rm -fr ${WORKSPACE}/site; mkdir -p ${WORKSPACE}/site/${JOB_NAME}
+rm -fr ${WORKSPACE}/results; mkdir -p ${STAGINGDIR}
 
 # check for aggregate zip or overall zip
 z=""
@@ -40,15 +43,16 @@
 if [[ $z != "" ]] && [[ -f $z ]] ; then
 	#echo "$z ..."
 	# note the job name, build number, and build ID of the latest snapshot zip
-	echo "JOB_NAME = ${JOB_NAME}" > ${WORKSPACE}/site/${JOB_NAME}/JOB_NAME.txt
-	echo "BUILD_NUMBER = ${BUILD_NUMBER}" > ${WORKSPACE}/site/${JOB_NAME}/BUILD_NUMBER.txt
-	echo "BUILD_ID = ${BUILD_ID}" > ${WORKSPACE}/site/${JOB_NAME}/BUILD_ID.txt
+	echo "JOB_NAME = ${JOB_NAME}" > ${STAGINGDIR}/JOB_NAME.txt
+	echo "BUILD_NUMBER = ${BUILD_NUMBER}" > ${STAGINGDIR}/BUILD_NUMBER.txt
+	echo "BUILD_ID = ${BUILD_ID}" > ${STAGINGDIR}/BUILD_ID.txt
 
 	# unzip into workspace for publishing as unpacked site
-	unzip -u -o -q -d ${WORKSPACE}/site/${JOB_NAME}/ $z
+	mkdir -p ${STAGINGDIR}/all/repo
+	unzip -u -o -q -d ${STAGINGDIR}/all/repo $z
 
 	# copy into workspace for access by bucky aggregator (same name every time)
-	rsync -aq $z ${WORKSPACE}/site/${SNAPNAME}
+	rsync -aq $z ${STAGINGDIR}/${SNAPNAME}
 fi
 z=""
 
@@ -58,29 +62,29 @@
 	if [[ $y != "aggregate" ]]; then # prevent duplicate nested sites
 		#echo "[$y] $z ..."
 		# unzip into workspace for publishing as unpacked site
-		mkdir -p ${WORKSPACE}/site/${JOB_NAME}/$y
-		unzip -u -o -q -d ${WORKSPACE}/site/${JOB_NAME}/$y $z
+		mkdir -p ${STAGINGDIR}/$y
+		unzip -u -o -q -d ${STAGINGDIR}/$y $z
 		# copy into workspace for access by bucky aggregator (same name every time)
-		rsync -aq $z ${WORKSPACE}/site/${JOB_NAME}/${y}${SUFFNAME}
+		rsync -aq $z ${STAGINGDIR}/${y}${SUFFNAME}
 	fi
 done
 
 # if zips exist produced & renamed by ant script, copy them too
-if [[ ! -f ${WORKSPACE}/site/${SNAPNAME} ]]; then
+if [[ ! -f ${WORKSPACE}/results/${SNAPNAME} ]]; then
 	for z in $(find ${WORKSPACE} -maxdepth 5 -mindepth 3 -name "*Update*.zip"); do 
 		#echo "$z ..."
-		unzip -u -o -q -d ${WORKSPACE}/site/${JOB_NAME}/ $z
-		rsync -aq $z ${WORKSPACE}/site/${SNAPNAME}
+		unzip -u -o -q -d ${STAGINGDIR}/ $z
+		rsync -aq $z ${WORKSPACE}/results/${SNAPNAME}
 	done
 fi
 
 # get sources zip
 if [[ -f ${WORKSPACE}/sources/build/sources/target/sources.zip ]]; then
-	rsync -aq ${WORKSPACE}/sources/build/sources/target/sources.zip ${WORKSPACE}/site/${JOB_NAME}/${SRCSNAME}
+	rsync -aq ${WORKSPACE}/sources/build/sources/target/sources.zip ${STAGINGDIR}/all/${SRCSNAME}
 else
 	# create sources zip
 	pushd ${WORKSPACE}/sources
-	zip ${WORKSPACE}/site/${JOB_NAME}/${SRCSNAME} -q -r * -x documentation\* -x download.jboss.org\* -x requirements\* \
+	zip ${STAGINGDIR}/all/${SRCSNAME} -q -r * -x documentation\* -x download.jboss.org\* -x requirements\* \
 	  -x workingset\* -x labs\* -x build\* -x \*test\* -x \*target\* -x \*.class -x \*.svn\* -x \*classes\* -x \*bin\* -x \*.zip \
 	  -x \*docs\* -x \*reference\* -x \*releng\*
 	popd
@@ -88,17 +92,18 @@
 
 # generate HTML snippet for inclusion on jboss.org
 if [[ ${RELEASE} == "Yes" ]]; then
+	ANT_PARAMS="-DZIPSUFFIX=${ZIPSUFFIX} -DJOB_NAME=${JOB_NAME} -Doutput.dir=${WORKSPACE}/results"
 	if [[ -f ${WORKSPACE}/build/results/build.xml ]]; then
-		ant -f ${WORKSPACE}/build/results/build.xml "-DZIPSUFFIX=${ZIPSUFFIX} -DJOB_NAME=${JOB_NAME}"
+		ant -f ${WORKSPACE}/build/results/build.xml ${ANT_PARAMS}
 	elif [[ -f ${WORKSPACE}/sources/build/results/build.xml ]]; then
-		ant -f ${WORKSPACE}/sources/build/results/build.xml "-DZIPSUFFIX=${ZIPSUFFIX} -DJOB_NAME=${JOB_NAME}"
+		ant -f ${WORKSPACE}/sources/build/results/build.xml ${ANT_PARAMS}
 	fi
 fi
 
 # get full build log and filter out Maven test failures
-bl=${WORKSPACE}/site/${JOB_NAME}/BUILDLOG.txt
+bl=${STAGINGDIR}/BUILDLOG.txt
 wget -q http://hudson.qa.jboss.com/hudson/job/${JOB_NAME}/${BUILD_NUMBER}/consoleText -O ${bl}
-fl=${WORKSPACE}/site/${JOB_NAME}/FAIL_LOG.txt
+fl=${STAGINGDIR}/FAIL_LOG.txt
 sed -ne "/<<< FAI/,+9 p" ${bl} | sed -e "/AILURE/,+9 s/\(.\+AILURE.\+\)/\n----------\n\n\1/g" > ${fl}
 sed -ne "/ FAI/ p" ${bl} | sed -e "/AILURE \[/ s/\(.\+AILURE \[.\+\)/\n----------\n\n\1/g" >> ${fl}
 sed -ne "/ SKI/ p" ${bl} | sed -e "/KIPPED \[/ s/\(.\+KIPPED \[.\+\)/\n----------\n\n\1/g" >> ${fl}
@@ -110,7 +115,7 @@
 if [[ $fc != "0" ]]; then
 	echo "" >> ${fl}; echo -n "SKI" >> ${fl}; echo -n "PS FOUND: "$fc >> ${fl};
 fi 
-el=${WORKSPACE}/site/${JOB_NAME}/ERRORLOG.txt
+el=${STAGINGDIR}/ERRORLOG.txt
 sed -ne "/<<< ERR/,+9 p" ${bl} | sed -e "/RROR/,+9 s/\(.\+RROR.\+\)/\n----------\n\n\1/g" > ${el}
 sed -ne "/\[ERR/,+2 p" ${bl} | sed -e "/ROR\] Fai/,+2 s/\(.\+ROR\] Fai.\+\)/\n----------\n\n\1/g" >> ${el}
 ec=$(sed -ne "/ERR\|RROR/ p" ${el} | wc -l) 
@@ -118,20 +123,20 @@
 	echo "" >> ${el}; echo -n "ERR" >> ${el}; echo "ORS FOUND: "$ec >> ${el};
 fi
 
-date
-rsync -arzq ${WORKSPACE}/site/${JOB_NAME}/*LOG.txt $DESTINATION/${JOB_NAME}/
-date
-
 # publish to download.jboss.org, unless errors found - avoid destroying last-good update site
 if [[ $ec == "0" ]] && [[ $fc == "0" ]]; then
 date
 	# publish update site dir
-	if [[ -d ${WORKSPACE}/site/${JOB_NAME} ]]; then
-		rsync -arzq --delete ${WORKSPACE}/site/${JOB_NAME} $DESTINATION/
+	if [[ -d ${STAGINGDIR} ]]; then
+		rsync -arzq --delete ${STAGINGDIR} $DESTINATION/
 	fi
 	# publish update site zip
-	if [[ -f ${WORKSPACE}/site/${SNAPNAME} ]]; then
-		rsync -arzq --delete ${WORKSPACE}/site/${SNAPNAME} $DESTINATION/
+	if [[ -f ${WORKSPACE}/results/${SNAPNAME} ]]; then
+		rsync -arzq --delete ${WORKSPACE}/results/${SNAPNAME} $DESTINATION/
 	fi
 fi
+
 date
+rsync -arzq ${STAGINGDIR}/*LOG.txt $DESTINATION/${JOB_NAME}/
+date
+

Modified: trunk/build/results/build.xml
===================================================================
--- trunk/build/results/build.xml	2010-07-14 20:43:38 UTC (rev 23408)
+++ trunk/build/results/build.xml	2010-07-14 22:30:14 UTC (rev 23409)
@@ -1,168 +1,168 @@
-<project default="build.results">
-
-	<!-- should be set by script or in Hudson -->
-	<property name="ZIPSUFFIX" value="SNAPSHOT" />
-
-	<!-- should be set by Hudson -->
-	<!-- <property name="JOB_NAME" value="jbosstools-3.2.0.M2.continuous" /> -->
-
-	<!-- if ${WORKSPACE}/site folder exists, target that folder; else generate here. -->
-	<condition property="output.dir" value="${WORKSPACE}/site" else="${basedir}">
-		<available file="${WORKSPACE}/site" />
-	</condition>
-
-	<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}" />
-	<echo level="info">WORKINGDIR = ${WORKINGDIR}</echo>
-
-	<condition property="COMMON_TOOLS" value="/home/hudson/static_build_env/jbds/tools">
-		<available file="/home/hudson/static_build_env/jbds" type="dir" />
-	</condition>
-	<condition property="COMMON_TOOLS" value="${WORKINGDIR}/../tools" else="${java.io.tmpdir}">
-		<available file="${WORKINGDIR}/../tools" type="dir" />
-	</condition>
-	<mkdir dir="${COMMON_TOOLS}" />
-	<echo level="info">COMMON_TOOLS = ${COMMON_TOOLS}</echo>
-
-	<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>
-	<!-- if can't calculate where build/build.xml is located, must pass in path from parent when calling this script -->
-
-	<target name="init">
-		<ant antfile="${build.xml}" target="init" />
-
-		<macrodef name="get.size">
-			<attribute name="file" />
-			<attribute name="property" />
-			<sequential>
-				<var name="size" unset="true" />
-				<var name="size-in-mb" unset="true" />
-				<if>
-					<available file="@{file}" />
-					<then>
-						<length file="@{file}" property="size" />
-						<math result="size-in-mb">
-							<op op="/">
-								<op op="floor">
-									<op op="*">
-										<op op="/">
-											<num value="${size}" />
-											<num value="1048576" />
-										</op>
-										<num value="100" />
-									</op>
-								</op>
-								<num value="100" />
-							</op>
-						</math>
-
-						<property name="@{property}" value="${size-in-mb}" />
-					</then>
-					<else>
-						<property name="@{property}" value="-1" />
-					</else>
-				</if>
-			</sequential>
-		</macrodef>
-		<taskdef resource="net/sf/antcontrib/antlib.xml">
-			<classpath>
-				<pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
-			</classpath>
-		</taskdef>
-	</target>
-
-	<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
-			3. manually copy the contents of this file into a page under 
-				http://www.jboss.org/tools/downloads/
-		-->
-		<for param="UPDATEZIP">
-			<path>
-				<fileset dir="${WORKINGDIR}/site">
-					<include name="*-Update-${ZIPSUFFIX}.zip" />
-					<include name="*-Sources-${ZIPSUFFIX}.zip" />
-				</fileset>
-			</path>
-			<sequential>
-				<var name="filename" unset="true" />
-				<propertyregex property="filename"
-				               input="@{UPDATEZIP}"
-				               defaultvalue="@{UPDATEZIP}"
-				               regexp=".+/([^/]+\.zip)"
-				               replace="\1"
-				               casesensitive="false"
-				               override="true"
-				/>
-				<propertyregex property="COMPONENT"
-				               input="${filename}"
-				               defaultvalue="${filename}"
-				               regexp="(.+)-(Update|Sources)-${ZIPSUFFIX}\.zip"
-				               replace="\1"
-				               casesensitive="false"
-				               override="true"
-				/>
-
-				<if>
-					<and>
-						<isset property="JOB_NAME" />
-						<equals arg1="${COMPONENT}" arg2="${JOB_NAME}" />
-					</and>
-					<then>
-						<if>
-							<equals arg1="${filename}" arg2="${JOB_NAME}-Sources-${ZIPSUFFIX}.zip" />
-							<then>
-								<var name="COMPONENT" unset="true" />
-								<var name="COMPONENT" value="sources" />
-							</then>
-							<elseif>
-								<equals arg1="${filename}" arg2="${JOB_NAME}-Update-${ZIPSUFFIX}.zip" />
-								<then>
-									<var name="COMPONENT" unset="true" />
-									<var name="COMPONENT" value="update" />
-								</then>
-							</elseif>
-						</if>
-					</then>
-				</if>
-
-				<echo level="verbose">UPDATEZIP = @{UPDATEZIP}
-COMPONENT = ${COMPONENT}</echo>
-				<property name="${COMPONENT}-filename" value="${filename}" />
-
-				<get.size file="@{UPDATEZIP}" property="${COMPONENT}-filesize" />
-
-				<!-- 
-				<var name="filesize" unset="true" />
-				<propertycopy from="${COMPONENT}-filesize" property="filesize" override="true" silent="true" />
-				<echo level="info">filesize =  ${filesize}</echo>
-				<echo level="info">filename =  ${filename}</echo>
-				<var name="filesize" unset="true" /> 
-				-->
-				<var name="filename" unset="true" />
-			</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" />
-	</target>
-
+<project default="build.results">
+
+	<!-- should be set by script or in Hudson -->
+	<property name="ZIPSUFFIX" value="SNAPSHOT" />
+
+	<!-- should be set by Hudson -->
+	<!-- <property name="JOB_NAME" value="jbosstools-3.2.0.M2.continuous" /> -->
+
+	<!-- if ${WORKSPACE}/site folder exists, target that folder; else generate here. -->
+	<condition property="output.dir" value="${WORKSPACE}/results" else="${basedir}">
+		<available file="${WORKSPACE}/results" />
+	</condition>
+
+	<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}" />
+	<echo level="info">WORKINGDIR = ${WORKINGDIR}</echo>
+
+	<condition property="COMMON_TOOLS" value="/home/hudson/static_build_env/jbds/tools">
+		<available file="/home/hudson/static_build_env/jbds" type="dir" />
+	</condition>
+	<condition property="COMMON_TOOLS" value="${WORKINGDIR}/../tools" else="${java.io.tmpdir}">
+		<available file="${WORKINGDIR}/../tools" type="dir" />
+	</condition>
+	<mkdir dir="${COMMON_TOOLS}" />
+	<echo level="info">COMMON_TOOLS = ${COMMON_TOOLS}</echo>
+
+	<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>
+	<!-- if can't calculate where build/build.xml is located, must pass in path from parent when calling this script -->
+
+	<target name="init">
+		<ant antfile="${build.xml}" target="init" />
+
+		<macrodef name="get.size">
+			<attribute name="file" />
+			<attribute name="property" />
+			<sequential>
+				<var name="size" unset="true" />
+				<var name="size-in-mb" unset="true" />
+				<if>
+					<available file="@{file}" />
+					<then>
+						<length file="@{file}" property="size" />
+						<math result="size-in-mb">
+							<op op="/">
+								<op op="floor">
+									<op op="*">
+										<op op="/">
+											<num value="${size}" />
+											<num value="1048576" />
+										</op>
+										<num value="100" />
+									</op>
+								</op>
+								<num value="100" />
+							</op>
+						</math>
+
+						<property name="@{property}" value="${size-in-mb}" />
+					</then>
+					<else>
+						<property name="@{property}" value="-1" />
+					</else>
+				</if>
+			</sequential>
+		</macrodef>
+		<taskdef resource="net/sf/antcontrib/antlib.xml">
+			<classpath>
+				<pathelement location="${COMMON_TOOLS}/ant-contrib.jar" />
+			</classpath>
+		</taskdef>
+	</target>
+
+	<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
+			3. manually copy the contents of this file into a page under 
+				http://www.jboss.org/tools/downloads/
+		-->
+		<for param="UPDATEZIP">
+			<path>
+				<fileset dir="${WORKINGDIR}/site">
+					<include name="*-Update-${ZIPSUFFIX}.zip" />
+					<include name="*-Sources-${ZIPSUFFIX}.zip" />
+				</fileset>
+			</path>
+			<sequential>
+				<var name="filename" unset="true" />
+				<propertyregex property="filename"
+				               input="@{UPDATEZIP}"
+				               defaultvalue="@{UPDATEZIP}"
+				               regexp=".+/([^/]+\.zip)"
+				               replace="\1"
+				               casesensitive="false"
+				               override="true"
+				/>
+				<propertyregex property="COMPONENT"
+				               input="${filename}"
+				               defaultvalue="${filename}"
+				               regexp="(.+)-(Update|Sources)-${ZIPSUFFIX}\.zip"
+				               replace="\1"
+				               casesensitive="false"
+				               override="true"
+				/>
+
+				<if>
+					<and>
+						<isset property="JOB_NAME" />
+						<equals arg1="${COMPONENT}" arg2="${JOB_NAME}" />
+					</and>
+					<then>
+						<if>
+							<equals arg1="${filename}" arg2="${JOB_NAME}-Sources-${ZIPSUFFIX}.zip" />
+							<then>
+								<var name="COMPONENT" unset="true" />
+								<var name="COMPONENT" value="sources" />
+							</then>
+							<elseif>
+								<equals arg1="${filename}" arg2="${JOB_NAME}-Update-${ZIPSUFFIX}.zip" />
+								<then>
+									<var name="COMPONENT" unset="true" />
+									<var name="COMPONENT" value="update" />
+								</then>
+							</elseif>
+						</if>
+					</then>
+				</if>
+
+				<echo level="verbose">UPDATEZIP = @{UPDATEZIP}
+COMPONENT = ${COMPONENT}</echo>
+				<property name="${COMPONENT}-filename" value="${filename}" />
+
+				<get.size file="@{UPDATEZIP}" property="${COMPONENT}-filesize" />
+
+				<!-- 
+				<var name="filesize" unset="true" />
+				<propertycopy from="${COMPONENT}-filesize" property="filesize" override="true" silent="true" />
+				<echo level="info">filesize =  ${filesize}</echo>
+				<echo level="info">filename =  ${filename}</echo>
+				<var name="filesize" unset="true" /> 
+				-->
+				<var name="filename" unset="true" />
+			</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" />
+	</target>
+
 </project>



More information about the jbosstools-commits mailing list