Author: nickboldt
Date: 2011-12-16 02:16:43 -0500 (Fri, 16 Dec 2011)
New Revision: 37390
Modified:
trunk/build/target-platform/publish.sh
Log:
check if target folder parent exists before trying to sftp/rsync into that parent folder
Modified: trunk/build/target-platform/publish.sh
===================================================================
--- trunk/build/target-platform/publish.sh 2011-12-16 07:03:25 UTC (rev 37389)
+++ trunk/build/target-platform/publish.sh 2011-12-16 07:16:43 UTC (rev 37390)
@@ -76,8 +76,14 @@
du -sh ${repoDir} ${destinationPath}/${targetZipFile}
# upload to
http://download.jboss.org/jbossotools/updates/target-platform_3.3.indigo/... for
public use
- if [[ ${DESTINATION/@/} == ${DESTINATION} ]]; then # local path, no user@server
+ if [[ ${DESTINATION/:/} == ${DESTINATION} ]]; then # local path, no user@server:/path
mkdir -p ${DESTINATION}/
+ else
+ DESTPARENT=${DESTINATION%/*}; NEWFOLDER=${DESTINATION##*/}
+ if [[ $(echo "ls" | sftp ${DESTPARENT} 2>&1 | grep ${NEWFOLDER}) ==
"" ]]; then
+ # DESTHOST=${DESTINATION%:*}; DESTFOLD=${DESTINATION#*:}; echo "mkdir
${DESTFOLD}" | sftp ${DESTHOST}; # alternate approach
+ echo "mkdir ${NEWFOLDER}" | sftp ${DESTPARENT}
+ fi
fi
# if the following line fails, make sure that ${DESTINATION} is already created on
target server
date; rsync -arzqc --protocol=28 --delete-after --delete-excluded --rsh=ssh ${exclude}
${include} ${DESTINATION}/latest/