Add filtered publishing

This commit is contained in:
Dan Hawkins 2019-03-19 12:54:50 +00:00
commit 7f8b0cf866

View file

@ -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)
}