Skip to content

Commit

Permalink
Jenkins wraps includes/excludes in single quotes and therefore ignore…
Browse files Browse the repository at this point in the history
…s them; try another approach to making this work
  • Loading branch information
nickboldt committed May 5, 2015
1 parent 3242674 commit c8b7cd8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions publish/rsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mkdir -p $tmpdir
DESTINATION=tools@filemgmt.jboss.org:/downloads_htdocs/tools # or devstudio@filemgmt.jboss.org:/www_htdocs/devstudio or /qa/services/http/binaries/RHDS
URL=http://download.jboss.org/jbosstools # or https://devstudio.redhat.com or http://www.qa.jboss.com/binaries/RHDS

INCLUDES=""
INCLUDES="*"
EXCLUDES=""

# can be used to publish a build (including installers, site zips, MD5s, build log) or just an update site folder
Expand Down Expand Up @@ -43,8 +43,8 @@ while [[ "$#" -gt 0 ]]; do
'-URL') URL="$2"; shift 1;; # override for JBDS publishing, eg., http://www.qa.jboss.com/binaries/RHDS
'-s') SOURCE_PATH="$2"; shift 1;; # ${WORKSPACE}/sources/site/target/repository/
'-t') TARGET_PATH="$2"; shift 1;; # mars/snapshots/builds/<job-name>/<build-number>/, mars/snapshots/updates/core/{4.3.0.Alpha1, master}/
'-i') INCLUDES="--include=\"$2\""; shift 1;;
'-e') EXCLUDES="--exclude=\"$2\""; shift 1;;
'-i') INCLUDES="$2"; shift 1;;
'-e') EXCLUDES="$2"; shift 1;;
esac
shift 1
done
Expand All @@ -61,7 +61,11 @@ else
fi

# copy the source into the target
rsync -arzq --protocol=28 ${INCLUDES} ${EXCLUDES} ${SOURCE_PATH}/* $DESTINATION/${TARGET_PATH}/
if [[ ${EXCLUDES} ]]; then
rsync -arzq --protocol=28 --exclude=${EXCLUDES} ${SOURCE_PATH}/${INCLUDES} $DESTINATION/${TARGET_PATH}/
else
rsync -arzq --protocol=28 ${SOURCE_PATH}/${INCLUDES} $DESTINATION/${TARGET_PATH}/
fi

# given TARGET_PATH=/downloads_htdocs/tools/mars/snapshots/builds/jbosstools-build-sites.aggregate.earlyaccess-site_master/2015-03-06_17-58-07-B13/all/repo/
# return mars/snapshots/builds/jbosstools-build-sites.aggregate.earlyaccess-site_master
Expand Down

0 comments on commit c8b7cd8

Please sign in to comment.