Commit 2544f8a6 authored by xujian's avatar xujian

xx

parent 11ee399b
@Library('jenkins-shared-library') _ @Library('jenkins-shared-library') _
import groovy.json.JsonOutput // 添加这一行以导入 JsonOutput
def base
def core
def htj
def web
pipeline { pipeline {
agent any agent any
...@@ -11,9 +15,18 @@ pipeline { ...@@ -11,9 +15,18 @@ pipeline {
def yamlFile = readFile('project.yaml') def yamlFile = readFile('project.yaml')
def xxx = log.wenj(yamlFile) def xxx = log.wenj(yamlFile)
def modules = xxx.base base = xxx.base
def jsonOutput = JsonOutput.prettyPrint(JsonOutput.toJson(modules)) core = xxx.core
echo "Modules JSON: ${jsonOutput}" 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