詹金斯管道中的选项

问题描述 投票:0回答:1

管道重试时是否启用超时?我尝试了代码..当超过超时时,重试选项正在工作,但没有超时。

stage (‘Build’) {

        options {
        retry(2)
        timeout(time: 10, unit: 'MINUTES')
        
        }
        steps {
           //code
        }
        post {  
            success { 
             //code
            }
        }
    }
jenkins jenkins-pipeline jenkins-groovy
1个回答
0
投票

是的,Jenkins 声明性管道中似乎存在错误。这是一个简单的重现:

pipeline {
    agent none
    stages {
        stage('With timeout') {
            options {
                retry(2)
                timeout(time: 5, unit: 'SECONDS')
            }
            steps {
                sleep time: 10, unit: 'SECONDS'
            }
        }
    }
}

它确实不应该成功。

© www.soinside.com 2019 - 2024. All rights reserved.