From 6cc9f1928d2dc28693bbc10f1165b80a3724b688 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 1 Mar 2019 23:34:08 +0000 Subject: [PATCH] Add publish item selector script --- publish/publish_item_select.groovy | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/publish/publish_item_select.groovy b/publish/publish_item_select.groovy index 56f7e37..ef39d78 100755 --- a/publish/publish_item_select.groovy +++ b/publish/publish_item_select.groovy @@ -1,5 +1,7 @@ #!/usr/local/bin/groovy -metarepo="git@hydra:jenkinsautobuild/Common_scripts.git" +metarepoext = "git@hydra:HMB_XR_5601_Releases/hmb_xr_5601_whole.git" + +commonscriptsrepo="git@hydra:jenkinsautobuild/Common_scripts.git" import hudson.model.* @@ -46,6 +48,15 @@ def gitCloneOrPull(String repo, String folder) { return [sout, serr] } +def loadmetaclass(String commonscripts) { + def metafolderscriptfile = "${commonscripts}/meta/folder.groovy" + log("Loading script: ${metafolderscriptfile}") + def script = new GroovyScriptEngine('.').with { + loadScriptByName(metafolderscriptfile) + } + return script +} + def String makeworking() { def r = ['whoami'].execute() r.waitFor() @@ -56,8 +67,10 @@ def String makeworking() { createfolder(rootfolder) def commonscripts = "${rootfolder}/commonscripts" - gitCloneOrPull(metarepo, commonscripts); + gitCloneOrPull(commonscriptsrepo, commonscripts); + def metascript = loadmetaclass(commonscripts) + return metascript } def List getItems() { @@ -67,7 +80,7 @@ def List getItems() { def p = ['pwd'].execute() p.waitFor() items.add(p.text) - items.add(metarepo) + items.add(metarepoext) items.add(metalevels) items.add("ATLAS_SERVICES CORE_INSTALL installers/**") @@ -82,6 +95,7 @@ def List getItems() { } makeworking() +loadmetaclass() count = 0 for (item in getItems()) { log (count)