本质上,我希望我的 Jenkinsfile 看起来像这样:
@Library('my-descriptive-pipline') _
myPipeline('arg1','arg2','arg3')
然后我的共享库(/vars/descriptivePipeline.groovy)将如下所示:
pipeline {
agent any
options {
skipDefaultCheckout()
}
environment {
}
stages {
stage('stageA') {
steps {
... Do something with arg1, arg2 or arg3
}
}
stage('stageB') {
steps {
... Do something with arg1, arg2 or arg3
}
}
....
我想集中管道配置,所以我不必担心 Jenkinsfile 蔓延。声明性管道可以做到这一点吗?