coderwhy-WEB前端系統(tǒng)課2022
定義在 stage 中Option
除了寫在 Pipeline
頂層,還可以寫在 stage
中,但是寫在 stage
中的 option
僅支持 retry、 timeout、timestamps
,或者是和 stage
相關(guān)的聲明式選項,比如 skipDefaultCheckout
。處于 stage 級別的 options 寫法如下
pipeline {
?agent any
?stages {
? ?stage('env1') {
? ? ?options { ? //定義在這里這對這個stage生效
? ? ? ?timeout(time: 2, unit: 'SECONDS') //超時時間2秒
? ? ? ?timestamps() ? ? ? ? ? ? ? ? ? ? //所有輸出每行都會打印時間戳
? ? ? ?retry(3) ? ?//流水線失敗后重試次數(shù)
?
標(biāo)簽: