Jenkins 动态管道未显示 BlueOcean 中的所有阶段

Jenkins dynamic Pipeline not showing all stages in BlueOcean

我有一个 Jenkins 管道脚本,其中的关键部分如下所示。一切似乎都在后台执行,但未在 BlueOcean 上显示。

我是做错了什么还是 UI 上的某种错误?

def projects = [
    [name: 'API', folder: 'api-tests', repo: 'url'],
    [name: 'UI',folder: 'selenium-tests', repo: 'url']
]

// Create List of build stages to suit
def jobs = [:]

pipeline {
    agent {
        kubernetes {
            cloud "url"
            yaml """contents"""
        }
    }
    stages {
        stage('Downstream Testing') {
            steps {
                script{
                    // Set up List<Map<String,Closure>> describing the builds
                    projects.each { project ->
                        print "Adding stages for ${project.folder}"
        
                        jobs[project.name] = {
                            stage("Checkout Project") {
                                ...
                            }
                            stage("Smoke Tests") {
                                dir("${project.folder}") {
                                        container('maven') {
                                            // Run the maven build
                                            sh """mvn package test"""
                                        }
                                    }
                                }
                            }
                    }
                    
                    // Run all Nth step for all Projects in Parallel. 
                    parallel jobs
                }
            }   
        }
    }
}

是的,Blueocean 中似乎有一个错误 UI。

该场景在脚本管道中运行良好,但在声明管道中同样失败

脚本化管道

def j=[:]
node {
    [
        [name: "api", folder: "api"],
        [name: "ui", folder: "ui"]
    ].each { m -> 
        j[m.name] = {
            stage('a') {
                echo "A"
            }
            stage('b') {
                echo "B"
            }
        }
    }
    parallel j
}

声明式管道

pipeline {
    agent any;
    stages {
        stage("parallel") {
            steps {
                script {
                    def j=[:]
                    [
                        [name: "api", folder: "api"],
                        [name: "ui", folder: "ui"]
                    ].each { m -> 
                        j[m.name] = {
                            stage('a') {
                                echo "A"
                            }
                            stage('b') {
                                echo "B"
                            }
                        }
                    }
                    parallel j
                }
            }
        }
    }
}