Commit 2544f8a6 authored by xujian's avatar xujian

xx

parent 11ee399b
@Library('jenkins-shared-library') _
import groovy.json.JsonOutput // 添加这一行以导入 JsonOutput
def base
def core
def htj
def web
pipeline {
agent any
......@@ -11,9 +15,18 @@ pipeline {
def yamlFile = readFile('project.yaml')
def xxx = log.wenj(yamlFile)
def modules = xxx.base
def jsonOutput = JsonOutput.prettyPrint(JsonOutput.toJson(modules))
echo "Modules JSON: ${jsonOutput}"
base = xxx.base
core = xxx.core
htj = xxx.htj
web = xxx.web
// 遍历 base 对象(假设 base 是一个集合)
if (base instanceof List) {
base.each { item ->
echo "Base Item: ${item.name}" // 输出每个项的内容
}
} else {
echo "Base is not a list"
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment