gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 15:05:57 24 4
gpt4 key购买 nike

我有一个 Jenkins 管道脚本,其中包含如下所示的关键部分。一切似乎都在后台执行,但没有显示在 BlueOcean 上。
enter image description here
我做错了什么还是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
}
enter image description here
声明式管道
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
}
}
}
}
}
enter image description here

关于jenkins-pipeline - Jenkins 动态管道未显示 BlueOcean 中的所有阶段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66106234/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com