From 7f8b0cf8667f2df714f1aeefc187e0366b148d4f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Mar 2019 12:54:50 +0000 Subject: [PATCH] Add filtered publishing --- publish/do.groovy | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/publish/do.groovy b/publish/do.groovy index c4bf7eb..749497a 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -104,13 +104,16 @@ def copydirectory(File dirFrom, File dirTo) { def filteredpublish(itempathstopublish, customer) { for (String itempath : itempathstopublish) { - def srcpath = "${releaserepofolder}/${itempath}" - def File srcpathfile = new File(srcpath) - def dstpath = "${filteredreleaserepofolder}/${itempath}" - def File dstpathfile = new File(dstpath) - def dstpathparentdir = dstpathfile.getParentFile() - echo "Copying recursively from ${srcpath} to ${dstpathparentdir.getAbsolutePath()}" - copydirectory(srcpathfile, dstpathparentdir) + def srcpathglob = "${releaserepofolder}/${itempath}" + def srcpaths = new FileNameFinder().getFileNames(srcpathglob) + for (String srcpath: srcpaths) { + def File srcpathfile = new File(srcpath) + def dstpath = "${filteredreleaserepofolder}/${itempath}" + def File dstpathfile = new File(dstpath) + def dstpathparentdir = dstpathfile.getParentFile() + echo "Copying recursively from ${srcpath} to ${dstpathparentdir.getAbsolutePath()}" + copydirectory(srcpathfile, dstpathparentdir) + } } publish(customer, filteredreleaserepofolder) }