Jenkins DSL pipeline syntax for wrappers or publishers

孤街醉人 提交于 2019-12-11 15:52:27

问题


I am using DSL Plugin 1.64. I have DSL script for generating jobs. generating pipeline jobs, somehow wrappers and publishers syntax are not working. I have already asked one question for wrappers, now I am trying to use publishers and its not working in pipeline job. I can not see for example groovyPostBuild step. even I can not not see a postbuild action in pipeline job, I don`t want to put this is pipeline jenkinsfile.

pipelineJob('Dump_File_Verification ') {
parameters {
        stringParam('DUMP_BUCKET', 'xxxxxxxx')
}
logRotator(-1, 50, -1, -1)
configure {
     it / definition / lightweight(true)
}
triggers {
    cron('0 */6 * * *')
}
concurrentBuild(false)


definition {
    cpsScm {
        scm {
            scriptPath ('Jenkinsfile')
            git {
                branches('*/dev')
                remote {
                    url ('git@github.com:xxxxxxx.git')
                    credentials ('xxxxxxxx')
                }
                extensions{
                    cloneOptions {
                      noTags(true)
                      shallow(true)
                      timeout(30)
                   }
                }
            }
        }
    }
}
publishers {
    groovyPostBuild('println "hello, world"', Behavior.MarkFailed)
        }}

回答1:


The Pipeline job type does not support publishers or post-build actions. It's a problem in Job DSL that the syntax is available and does not cause a runtime error. See JENKINS-31832 in the Jenkins bug tracker.



来源:https://stackoverflow.com/questions/48193600/jenkins-dsl-pipeline-syntax-for-wrappers-or-publishers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!