From a47bbf868ef39fe7619c1c192b3b706d5b0b9679 Mon Sep 17 00:00:00 2001 From: dany Date: Thu, 29 Sep 2022 22:51:04 +0200 Subject: [PATCH] Update 'Jenkinsfile' --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ebea94a..e738708 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,8 +1,11 @@ // need to approve all static functions in Dashboard > Manage Jenkins > ScriptApproval def copyArtifactsByBranches(projectName){ - jenkins.model.Jenkins.instance.getItemByFullName('gitea-sync/antos').getAllJobs().each { job -> - copyArtifacts(projectName: 'gitea-sync/antos/' + job.getName(), target: 'build/frontend/' + job.getName()); - } + def jobs = jenkins.model.Jenkins.instance.getItemByFullName('gitea-sync/antos').getAllJobs(); + Iterator iterator = jobs.iterator(); + while (iterator.hasNext()) { + def job = iterator.next(); + copyArtifacts(projectName: 'gitea-sync/antos/' + job.getName(), target: 'build/frontend/' + job.getName()); + } } pipeline{ agent { node{ label'workstation' }}