Add filtered publishing

This commit is contained in:
Dan Hawkins 2019-03-19 11:20:02 +00:00
commit 889d2b8797

View file

@ -88,7 +88,7 @@ def publish(String customer, String finalreleaserepofolder = releaserepofolder)
def copydirectory(File dirFrom, File dirTo) {
if (!dirTo.exists()) {
dirTo.mkdir();
dirTo.mkdirs();
}
dirFrom.eachFile(FILES) { File source ->
File target = new File(dirTo, source.getName())
@ -103,12 +103,12 @@ def copydirectory(File dirFrom, File dirTo) {
def filteredpublish(itempathstopublish, customer) {
for (String itempath : itempathstopublish) {
def srcpath = "${releaserepofolder}/${itempath}"
File srcpathfile = new File(srcpath)
def File srcpathfile = new File(srcpath)
def dstpath = "${filteredreleaserepofolder}/${itempath}"
File dstpathfile = new File(dstpath)
def dstpathdirname = dstpathfile.getParent()
echo "Copying recursively from ${srcpath} to ${dstpath}"
copydirectory(srcpathfile, dstpathfile)
def File dstpathfile = new File(dstpath)
def dstpathparentdir = dstpathfile.getParentFile()
echo "Copying recursively from ${srcpath} to ${dstpathparentdir.getName()}"
copydirectory(srcpathfile, dstpathparentdir)
}
publish(customer, filteredreleaserepofolder)
}