DSL 插件包装器不起作用



DSL脚本是用groovy编写的。我正在尝试将包装器用于管道作业。运行 dsl 脚本后,我看不到相同的内容。我也在其他一些DSL API上看到了这个问题,我是否使用了错误的方式还是什么。Jenkins 版本是 2.89.2,DSL、管道、工作区、logsizechecker 插件是最新的并已安装。

pipelineJob('dev') {
parameters {
    stringParam('NICK', 'vgn')
    stringParam('ECR_REPO', 'xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com')
    stringParam('ECRHOTFIX_TAG', '')
}
logRotator(-1, 50, -1, -1)
configure {
     it / definition / lightweight(true)
}
triggers {
    cron('0 */6 * * *')
}
concurrentBuild(false)
wrappers {
    preBuildCleanup()
    logSizeChecker {
        maxSize(1024)
    }
}
definition {
    cpsScm {
        scm {
            scriptPath ('Jenkinsfile')
            git {
                branches('*/dev')
                remote {
                    url ('git@github.com:xxxxx/xxxxxx.git')
                    credentials ('jenkins-key')
                }
                extensions{
                    cloneOptions {
                      noTags(true)
                      shallow(true)
                      timeout(30)
                   }
                }
            }
        }
    }
}

}

管道作业类型不支持包装器。作业 DSL 中的一个问题是语法可用且不会导致运行时错误。请参阅 Jenkins bug 跟踪器中的 JENKINS-31832。

最新更新