Author: nickboldt
Date: 2010-10-04 15:20:20 -0400 (Mon, 04 Oct 2010)
New Revision: 25466
Modified:
trunk/build/publishUpdateZipToStaging.sh
Log:
parameterize and rename while downloading (skip a step)
Modified: trunk/build/publishUpdateZipToStaging.sh
===================================================================
--- trunk/build/publishUpdateZipToStaging.sh 2010-10-04 18:57:44 UTC (rev 25465)
+++ trunk/build/publishUpdateZipToStaging.sh 2010-10-04 19:20:20 UTC (rev 25466)
@@ -1,11 +1,26 @@
-# Use this script to publisher a single update site zip via a Hudson job
+# Use this script to publish a single update site zip via a Hudson job
+if [[ $1 ]]; then
+ # specify job to publish on commandline
+ JOBNAMEREDUX=$1
+elif [[ ${JOB_NAME} ]]; then
+ # pull name of the job to publish from the name of the publisher job
+ JOBNAMEREDUX=${JOB_NAME/-publish}
+else
+ echo "Must run from Hudson or manually specify job name"
+ echo "(for offline testing), eg., $0 jbosstools-teiid-designer"
+ exit 1
+fi
+
+if [[ $DESTINATION == "" ]]; then
DESTINATION="tools@filemgmt.jboss.org:/downloads_htdocs/tools"; fi
+
# get zip name from zip.list.txt
-path=$(wget -q
http://download.jboss.org/jbosstools/builds/staging/${JOB_NAME}/logs/zip.... -O - |
egrep -- "-Update-" | head -1 | sed "s#,\\\\##");
+path=$(wget -q
http://download.jboss.org/jbosstools/builds/staging/${JOBNAMEREDUX}/logs/... -O -
| egrep -- "-Update-" | head -1 | sed "s#,\\\\##");
-# get zip to local
-rsync -arzq
tools@filemgmt.jboss.org:/downloads_htdocs/tools/builds/staging/${JOB_NAME}/${path} .
+echo "Fetch ${path} as ${JOBNAMEREDUX}-Update.zip"
+# to test locally, may need to use --protocol=29 and -P instead of -q
+date; rsync -arzq --rsh=ssh ${DESTINATION}/builds/staging/${JOBNAMEREDUX}/${path}
${JOBNAMEREDUX}-Update.zip
-# push renamed zip to remote
-cd ${path%/*}; rsync -arzq ${path##*/}
tools@filemgmt.jboss.org:/downloads_htdocs/tools/updates/staging/${JOB_NAME}-Update.zip
-
+echo "Publish ${path} as ${JOBNAMEREDUX}-Update.zip"
+# to test locally, may need to use --protocol=29 and -P instead of -q
+date; rsync -arzq --rsh=ssh ${JOBNAMEREDUX}-Update.zip ${DESTINATION}/updates/staging/