From 944f732e896a578636bc72be9851eba8032aa0ae Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Mar 2019 08:54:45 +0000 Subject: [PATCH] Add filtered publishing --- versioncontrol/git.groovy | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/versioncontrol/git.groovy b/versioncontrol/git.groovy index f7d10bb..9a313f2 100644 --- a/versioncontrol/git.groovy +++ b/versioncontrol/git.groovy @@ -19,6 +19,16 @@ def SparseCheckoutPaths sparsecheckoutconfig(ArrayList paths) { return new SparseCheckoutPaths(sparsecheckoutpaths) } +def guessreporoot(componentURL) { + if (!env.REPO_ROOT || env.REPO_ROOT.size() == 0) { + return '' + } + def guess = componentURL.replaceFirst(/.*\/(.*).git/, '$1') + def reporoot = "${REPO_ROOT}/${guess}" + echo "Guessing reporoot is: ${reporoot}" + return reporoot +} + def gitCheckout(String gitURL, String revision, String targetDir, String repoRootSuffix = "", int cloneDepth = 1, boolean shallowClone = true, ArrayList sparseitemlist = new ArrayList()) { reporootenv = env.REPO_ROOT if (reporootenv != null && repoRootSuffix != "") {