【发布时间】:2019-08-13 06:24:24
【问题描述】:
我的 Jenkins 管道中有两个独立的函数,我想从第二个函数调用第一个函数。
我尝试了以下代码。
def first(){
return{
stages{
stage("test"){
steps{
echo "ok"
}
}
}
}
}
def second(){
return{
first().call()
}
}
pipeline {
agent any
stages{
stage("Run"){
steps{
script{
second().call()
}
}
}
}
}
这是否可能。建议我正确的方式。
【问题讨论】:
标签: function jenkins-pipeline nested-function