Author: nickboldt
Date: 2011-01-19 17:35:08 -0500 (Wed, 19 Jan 2011)
New Revision: 28407
Modified:
trunk/build/publish.sh
Log:
publish.sh now uses Hudson xml api to fetch SVN_REVISION and creates both xml and txt
files
Modified: trunk/build/publish.sh
===================================================================
--- trunk/build/publish.sh 2011-01-19 19:08:40 UTC (rev 28406)
+++ trunk/build/publish.sh 2011-01-19 22:35:08 UTC (rev 28407)
@@ -52,27 +52,13 @@
bl=${STAGINGDIR}/logs/BUILDLOG.txt
wget -q
http://hudson.qa.jboss.com/hudson/job/${JOB_NAME}/${BUILD_NUMBER}/console... -O
${bl}
-# JBDS-1361 - instead of SVN_REVISION, scrape ${bl} (BUILDLOG.txt)
-# Updating
http://anonsvn.jboss.org/repos/tdesigner/branches/7.1
-# ...
-# At revision 1063
-# Updating
http://anonsvn.jboss.org/repos/jbosstools/trunk/build
-# ...
-# At revision 25503
-# -- or --
-# Checking out
https://svn.jboss.org/repos/jbosstools/branches/jbosstools-3.2.0.Beta1
-# ...
-# At revision 25538
-rl=${STAGINGDIR}/logs/SVN_REVISION.txt
+# JBDS-1361 - fetch XML and then sed it into plain text
+rl=${STAGINGDIR}/logs/SVN_REVISION
+rm -f ${rl}.txt ${rl}.xml
+wget -q --no-clobber -O ${rl}.xml
"http://hudson.qa.jboss.com/hudson/job/${JOB_NAME}/${BUILD_NUMBER}/api/xml?depth=1&xpath=//build[1]/changeSet"
+sed -e
"s#<module>\(http[^<>]\+\)</module><revision>\([0-9]\+\)</revision>#\1\@\2\n#g"
${rl}.xml | \
+ sed -e "s#<kind>\([^<>]\+\)</kind>#\1\n#g" | sed -e
"s#<[^<>]\+>##g" > ${rl}.txt
-# convert input above to:
-#
http://anonsvn.jboss.org/repos/tdesigner/branches/7.1@1063
-#
http://anonsvn.jboss.org/repos/jbosstools/trunk/build@25503
-#
https://svn.jboss.org/repos/jbosstools/branches/jbosstools-3.2.0.Beta1@25538
-sed -ne "/Updating \(http.\+\)\|Checking out \(http.\+\)\|At revision \([0-9]\+\)/
p" ${bl} | \
- sed -e "/At revision/ s/At revision /\@/" | sed -e N -e '/http/
s/\n//' | \
- sed -e "/Checking out\|Updating/,+1 s/\(Checking out \|Updating
\)\(.\+\)/\2/g" > ${rl}
-
METAFILE="${BUILD_ID}-H${BUILD_NUMBER}.txt"
if [[ ${SVN_REVISION} ]]; then
METAFILE="${BUILD_ID}-H${BUILD_NUMBER}-r${SVN_REVISION}.txt"
Property changes on: trunk/build/publish.sh
___________________________________________________________________
Name: svn:executable
+ *