以下の内容はhttps://baba-s.hatenablog.com/entry/2020/09/22/230900より取得しました。


【Jenkins】Jenkins Pipeline でステージごとにタイムアウトを設定する方法

概要

方法1

pipeline {
    agent any

    stages {
        stage("Hello") {
            steps {
                script {
                    timeout(time: 5, unit: "SECONDS") {
                        sleep 10
                        echo "Hello World"
                    }
                }
            }
        }
    }
}

方法2

pipeline {
    agent any

    stages {
        stage("Hello") {
            options {
                timeout(time: 5, unit: "SECONDS")
            }
            steps {
                sleep 10
                echo "Hello World"
            }
        }
    }
}

備考

タイムアウトした場合のリザルトは Aborted になる

参考サイト様




以上の内容はhttps://baba-s.hatenablog.com/entry/2020/09/22/230900より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14