Add filtered publishing

This commit is contained in:
Dan Hawkins 2019-03-19 13:34:40 +00:00
commit 36ca33077f

View file

@ -104,9 +104,14 @@ def copydirectory(File dirFrom, File dirTo) {
def filteredpublish(itempathstopublish, customer) {
for (String itempath : itempathstopublish) {
// Convert glob wildcard paths to real paths
echo "Finding files at base folder: ${releaserepofolder} and glob filter: ${itempath}"
def srcpaths = new FileNameFinder().getFileNames(releaserepofolder, itempath)
def defaultsrcpath = "${releaserepofolder}/${itempath}"
def srcpaths = [ defaultsrcpath ]
if (itempath.endsWith('**') { // Convert glob wildcard paths to real paths
File srcfilepath = new File(defaultsrcpath).getParentFile()
def globpattern = '**'
echo "Finding files at base folder: ${srcfilepath} and glob filter: ${globpattern}"
srcpaths = new FileNameFinder().getFileNames(releaserepofolder, globpattern)
}
echo "Paths found: ${srcpaths}"
for (String srcpath: srcpaths) {
def File srcpathfile = new File(srcpath)