问题是,尽管事实上在2016年9月Beta版中提供了声明式管道,但您引用的博客文章(自10月起)记录的是脚本化管道,而不是声明式的(声明不多,所以我觉得您痛)。尚未将可锁定资源作为声明性管道步骤来使用,而该方式不能启用您正在寻找的功能。
你可以做:
pipeline { agent { label 'docker' } stages { stage('one') { steps { lock('something') { echo 'stage one' } } } }}
但是你不能做:
pipeline { agent { label 'docker' } stages { lock('something') { stage('one') { steps { echo 'stage one' } } stage('two') { steps { echo 'stage two' } } } }}
而且你不能做:
pipeline { agent { label 'docker' } stages { stage('one') { lock('something') { steps { echo 'stage one' } } } }}
您可以在此用例中使用脚本化管道。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)