From 94a966c7cd4e055acf894b34a4edd4bcdd3d4740 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Mar 2019 08:52:40 +0000 Subject: [PATCH] Add filtered publishing --- publish/do.groovy | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/publish/do.groovy b/publish/do.groovy index 14286b9..e637e8f 100644 --- a/publish/do.groovy +++ b/publish/do.groovy @@ -41,14 +41,9 @@ def summaryappend(String summary) { summarystring += summary } -def guessreporoot(componentURL) { - if (!env.REPO_ROOT || env.REPO_ROOT.size() == 0) { - return '' - } +def guessreporootsuffix(componentURL) { def guess = componentURL.replaceFirst(/.*\/(.*).git/, '$1') - def reporoot = "${REPO_ROOT}/${guess}" - echo "Guessing reporoot is: ${reporoot}" - return reporoot + return guess } gh = load("${autobuilder.commonscripts()}/versioncontrol/git.groovy") @@ -66,8 +61,8 @@ def getcomponentartifacts(releaseinfo, String repofolder, String tempfolder) { publishablePaths.add(publishableitem.filepath) summaryappend("${publishableitem.filepath},") } - def reporoot = guessreporoot(componentURL) - gh.gitCheckout(componentURL, revision, repofolder, reporoot, 1, true, publishablePaths) // Shallow clone + def reporootsuffix = guessreporootsuffix(componentURL) + gh.gitCheckout(componentURL, revision, reporootsuffix, reporoot, 1, true, publishablePaths) // Shallow clone } else { summaryappend("None ")