【发布时间】:2019-05-20 15:30:03
【问题描述】:
我有一个脚本化的管道,我想将它移植到声明性形式。我曾经有过
// Stages used in developement after each single commit
stage('Build') {
}
stage('Unit Tests') {}
// Other stages only for developer
[...]
// Stages used in test only once per day for instance
stage('Deploy') {
if ( testJob() ) {
} else {
Utils.markStageSkippedForConditional(STAGE_NAME)
}
}
[...]
// Other stages for more testing
然后,对于为开发人员运行的作业,只有在 Jenkins 中可见的管道的第一阶段。 在声明中,我有:
pipeline {
[...]
stages {
stage ('Build') {
[...]
}
stage ('Unit Tests') {
[...]
}
[...]
stage ('Deploy') {
when { expression { testJob() }
[...]
}
[...]
}
}
但即使是开发工作,我也看到了所有阶段。 有没有办法获得与脚本化管道相同的行为?
【问题讨论】:
标签: jenkins-pipeline visualization declarative