pipeline step description

Posted i舒

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了pipeline step description相关的知识,希望对你有一定的参考价值。

 

 

修改前:

    echo \'Hello World\'

给step添加label:

sh script: " echo \'Hello World\'", label: "tet it"

添加后多了一个字段: "parameterDescription", 这个字段保存了执行的命令

https://www.e-learn.cn/topic/3024674

https://github.com/jenkinsci/pipeline-stage-view-plugin/tree/master/rest-api#get-jobjob-namewfapiruns

添加label前:

{
"_links": {
"self": {
"href": "/job/te_pipeline/3/execution/node/11/wfapi/describe"
}
},
"id": "11",
"name": "test",
"execNode": "",
"status": "SUCCESS",
"startTimeMillis": 1625238851132,
"durationMillis": 4270,
"pauseDurationMillis": 0,
"stageFlowNodes": [{
"_links": {
"self": {
"href": "/job/te_pipeline/3/execution/node/12/wfapi/describe"
},
"log": {
"href": "/job/te_pipeline/3/execution/node/12/wfapi/log"
},
"console": {
"href": "/job/te_pipeline/3/execution/node/12/log"
}
},
"id": "12",
"name": "Shell Script",
"execNode": "",
"status": "SUCCESS",
"parameterDescription": " echo \'Hello World\'",
"startTimeMillis": 1625238852265,
"durationMillis": 3060,
"pauseDurationMillis": 0,
"parentNodes": ["11"]
}]
}

添加 label 后

{
"_links": {
"self": {
"href": "/job/te_pipeline/5/execution/node/11/wfapi/describe"
}
},
"id": "11",
"name": "test",
"execNode": "",
"status": "SUCCESS",
"startTimeMillis": 1625240102435,
"durationMillis": 784,
"pauseDurationMillis": 0,
"stageFlowNodes": [{
"_links": {
"self": {
"href": "/job/te_pipeline/5/execution/node/12/wfapi/describe"
},
"log": {
"href": "/job/te_pipeline/5/execution/node/12/wfapi/log"
},
"console": {
"href": "/job/te_pipeline/5/execution/node/12/log"
}
},
"id": "12",
"name": "tet it",
"execNode": "",
"status": "SUCCESS",
"parameterDescription": " echo \'Hello World\'",
"startTimeMillis": 1625240102561,
"durationMillis": 625,
"pauseDurationMillis": 0,
"parentNodes": ["11"]
}]
}

以上是关于pipeline step description的主要内容,如果未能解决你的问题,请参考以下文章

21-Jenkins-Pipeline-Pipeline Utility Steps插件之findFiles方法

26-Jenkins-Pipeline-Pipeline Basic Steps插件之isUnixretrysleep方法

27-Jenkins-Pipeline-Pipeline Basic Steps插件之timeoutwaitUntilwithEnv方法

23-Jenkins-Pipeline-Pipeline Utility Steps插件之readProperties方法

28-Jenkins-Pipeline-Pipeline Basic Steps插件之readFile和writeFile方法

22-Jenkins-Pipeline-Pipeline Utility Steps插件之readJson和writeJson方法