Wiki中的文档有些误导。这是有效的解决方案。
job_name = "my-pipeline-job"println "script: ${ __FILE__}"println("script directory: ${new File(__FILE__).parent}")job_path = "${new File(__FILE__).parent}"jenkinsfile = job_path + "/Jenkinsfile"pipelineJob(job_name){ description("Jenkins pipeline job") parameters{ stringParam("MyTestParam", "", "a sample parameter") } definition { cps { sandbox() script(readFileFromWorkspace(jenkinsfile)) } }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)