Skip to content

Commit

Permalink
add optional includes/excludes to allow rsyncing a whle folder (minus…
Browse files Browse the repository at this point in the history
… some file(s)), eg., for pushing JBDS installers to ds.rh, but excluding the EAP one
  • Loading branch information
nickboldt committed May 5, 2015
1 parent 5036c3e commit 3242674
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion publish/rsync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ 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=""
EXCLUDES=""

# can be used to publish a build (including installers, site zips, MD5s, build log) or just an update site folder
usage ()
{
Expand Down Expand Up @@ -40,6 +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;;
esac
shift 1
done
Expand All @@ -56,7 +61,7 @@ else
fi

# copy the source into the target
rsync -arzq --protocol=28 ${SOURCE_PATH}/* $DESTINATION/${TARGET_PATH}/
rsync -arzq --protocol=28 ${INCLUDES} ${EXCLUDES} ${SOURCE_PATH}/* $DESTINATION/${TARGET_PATH}/

# 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 3242674

Please sign in to comment.