diff --git a/Jenkinsfile b/Jenkinsfile index c559083..dcbdc39 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,6 @@ // need to approve all static functions in Dashboard > Manage Jenkins > ScriptApproval -def ArrayList copyArtifactsByBranches(projectName){ - def jobs = jenkins.model.Jenkins.instance.getItemByFullName('gitea-sync/antos').getAllJobs(); +def ArrayList getBranches(projectName){ + def jobs = jenkins.model.Jenkins.instance.getItemByFullName(projectName).getAllJobs(); Iterator iterator = jobs.iterator(); def arr = new ArrayList(); @@ -19,7 +19,7 @@ def generateStage(name) { } } -def parallelStagesMap = jenkins.model.Jenkins.instance.getItemByFullName('gitea-sync/antos').getAllJobs().collectEntries { +def parallelStagesMap = getBranches("gitea-sync/antos").collectEntries { ["${it}" : generateStage(it)] }