From b77980eebed4cb74c2624ef5e9777de75c93924f Mon Sep 17 00:00:00 2001 From: dany Date: Thu, 29 Sep 2022 23:13:25 +0200 Subject: [PATCH] Update 'Jenkinsfile' --- Jenkinsfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8152035..1b63015 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,15 @@ // need to approve all static functions in Dashboard > Manage Jenkins > ScriptApproval +def parallelStagesMap = jenkins.model.Jenkins.instance.getItemByFullName('gitea-sync/antos').getAllJobs().collectEntries { + ["${it}" : generateStage(it.getName())] +} +def generateStage(name) { + return { + stage("stage: ANTOS ${name}") { + copyArtifacts(projectName: 'gitea-sync/antos/' + name, target: 'build/frontend/' + name); + } + } +} + def copyArtifactsByBranches(projectName){ def jobs = jenkins.model.Jenkins.instance.getItemByFullName('gitea-sync/antos').getAllJobs(); Iterator iterator = jobs.iterator(); @@ -12,6 +23,8 @@ def copyArtifactsByBranches(projectName){ } return null; } + + pipeline{ agent { node{ label'workstation' }} options { @@ -48,7 +61,7 @@ pipeline{ copyArtifacts(projectName: 'luasec', target: 'build/backend'); script { - copyArtifactsByBranches("gitea-sync/antos"); + parallel(parallelStagesMap); } //copyArtifacts(projectName: 'gitea-sync/antos/*', target: 'build/frontend'); //copyArtifacts(projectName: 'gitea-sync/antd-web-apps/master', target: 'build/backend');