[jbosstools-commits] JBoss Tools SVN: r42174 - trunk/build/publish.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Jun 22 06:47:22 EDT 2012


Author: fbricon
Date: 2012-06-22 06:47:22 -0400 (Fri, 22 Jun 2012)
New Revision: 42174

Modified:
   trunk/build/publish/publish.sh
Log:
Fix the case where more than 1 git repo are used to build 

m2e-wtp and m2e-wtp-tests are in 2 git repos and build in the same job
/job/${JOB_NAME}/${BUILD_NUMBER}/api/xml?xpath=//lastBuiltRevision would fail because there are 2 nodes.
As a workaround, we take the 1st one we find :
/job/${JOB_NAME}/${BUILD_NUMBER}/api/xml?xpath=(//lastBuiltRevision)[1]

Modified: trunk/build/publish/publish.sh
===================================================================
--- trunk/build/publish/publish.sh	2012-06-22 10:44:16 UTC (rev 42173)
+++ trunk/build/publish/publish.sh	2012-06-22 10:47:22 UTC (rev 42174)
@@ -79,9 +79,9 @@
 wgetParams="--timeout=900 --wait=10 --random-wait --tries=30 --retry-connrefused --no-check-certificate --server-response"
 rl=${STAGINGDIR}/logs/REVISION
 if [[ $(find ${WORKSPACE} -mindepth 2 -maxdepth 3 -name ".git") ]]; then
-	# Track git source revision through hudson api: /job/${JOB_NAME}/${BUILD_NUMBER}/api/xml?xpath=//lastBuiltRevision
+	# Track git source revision through hudson api: /job/${JOB_NAME}/${BUILD_NUMBER}/api/xml?xpath=(//lastBuiltRevision)[1]
 	rl=${STAGINGDIR}/logs/GIT_REVISION
-	rm -f ${rl}.txt ${rl}.xml; wget -O ${rl}.xml "http://hudson.qa.jboss.com/hudson/job/${JOB_NAME}/${BUILD_NUMBER}/api/xml?xpath=//lastBuiltRevision" ${wgetParams}
+	rm -f ${rl}.txt ${rl}.xml; wget -O ${rl}.xml "http://hudson.qa.jboss.com/hudson/job/${JOB_NAME}/${BUILD_NUMBER}/api/xml?xpath=%28//lastBuiltRevision%29[1]" ${wgetParams}
 	sed -e "s#<lastBuiltRevision><SHA1>\([a-f0-9]\+\)</SHA1><branch><SHA1>\([a-f0-9]\+\)</SHA1><name>\([^<>]\+\)</name></branch></lastBuiltRevision>#\3\@\1#g" ${rl}.xml | sed -e "s#<[^<>]\+>##g" > ${rl}.txt
 elif [[ $(find ${WORKSPACE} -mindepth 2 -maxdepth 3 -name ".svn") ]]; then
 	# Track svn source revision through hudson api: /job/${JOB_NAME}/api/xml?wrapper=changeSet&depth=1&xpath=//build[1]/changeSet/revision



More information about the jbosstools-commits mailing list