当前位置:网站首页>Pipeline post instruction
Pipeline post instruction
2022-06-24 12:24:00 【Chen Bucheng I】
One . Introduce
post The steps are included throughout pipeline Or some additional steps after the phase is completed .post The steps are optional , So it is not included in the declarative pipeline In the simplest structure , But that doesn't mean it doesn't work very well .
Usually used for exception handling , If the last stage fails , Then do some operations . For example, cleaning up dependent packages in the previous stage , After judging that the cleanup failed , Send email to alarm and exit .
Two . Parameter description
Parameter position : pipeline or steps part , According to the completion status , use sb.'s judgement .
Specific parameters :
- always: No matter what the current completion status is , All implemented
- changed: Execute as long as the current completion state is different from the last one
- fixed: The last completion state was failed or unstable (unstable), Execute when the current completion status is success
- regression: The last completion status is success , The current completion status is failed 、 Unstable or suspended (aborted) When the
- aborted: When the current execution result is aborted ( Generally, it is artificially suspended ) perform
- failure: Execute when the current completion status is failed
- success: Execute when the current completion status is success
- unstable: Execute when the current completion state is unstable
- cleanup: Clean up the condition block . No matter what the current completion status is , After all other condition blocks are executed .post A section can contain multiple conditional blocks at the same time . Here are post A complete example of the section
Be careful :
- post Step in phase , by steps Later description
- post Every step of judgment , Will match , Instead of the first match , Others skip
3、 ... and . Using examples
Write a simple example :
pipeline {agent anystages {stage('test'){steps {echo 'test'}post {always {echo "post condition executed: always ..."}changed {echo "post condition executed: changed ..."}aborted {echo "post condition executed: aborted ..."}}}}}
When writing the article , Added regression Judgment of options , However, the following error is reported by the execution , Show the current pipeline The plug-in does not support this option , So in the above example, we have removed .
Re execution , You can see the display 2 Outputs ,always Each time, it will display , Because I failed last time , This time steps Of echo Successful implementation , It shows changed.
边栏推荐
- 11+的基于甲基化组和转录组综合分析识别葡萄膜黑色素瘤中新的预后 DNA 甲基化特征~
- How can I open an account with new bonds? Is it safe
- Adjustment method of easynvr video platform equipment channel page display error
- 怎么可以打新债 开户是安全的吗
- Linker --- linker
- Database migration tool flyway vs liquibase (II)
- Tsingsee green rhino video "cloud side end" +ai intelligent security system is integrated into the mainstream development trend
- Deep parsing and implementation of redis pub/sub publish subscribe mode message queue
- 广发证券靠谱吗?开证券账户安全吗?
- How to open a new bond? Is it safe to open an account
猜你喜欢

Tools and methods - use code formatting tools in source insight

New progress in the construction of meituan's Flink based real-time data warehouse platform

Opencv learning notes - Discrete Fourier transform

《opencv学习笔记》-- 离散傅里叶变换

Opencv learning notes - loading and saving images

ArrayList#subList这四个坑,一不小心就中招

我真傻,招了一堆只会“谷歌”的程序员!

ArrayList # sublist these four holes, you get caught accidentally
Deep parsing and implementation of redis pub/sub publish subscribe mode message queue

u盘安装kali并且持久化
随机推荐
10 zeros of D
Adjustment method of easynvr video platform equipment channel page display error
Basic path test of software test on the function of the previous day
怎么可以打新债 开户是安全的吗
怎样打新债具体操作 开户是安全的吗
Ingenious conception - iron death regulatory factor classification and prognosis 6+
Install MySQL in docker and modify my CNF profile
《opencv学习笔记》-- 图像的载入和保存
QT -- the qtabwidget supports dragging tabbar items
Single gene pan cancer + simple experiment can be published 7 points+
How to purchase new bonds is it safe to open an account
[go language questions] go from 0 to entry 4: advanced usage of slice, elementary review and introduction to map
GTest从入门到入门
What code did the full stack programmer write this month?
GTEST from getting started to getting started
Tencent cloud and the ICT Institute launched the preparation of the "cloud native open source white paper" to deeply interpret cloud native
如何优雅的写 Controller 层代码?
怎样购买打新债 开户是安全的吗
11+ article - machine learning builds Protics framework - deeply reveals the impact of tumor infiltrating immune cells in different molecular subtypes on prognosis
C语言循环语句介绍(foe、while、do...while)