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');