zoukankan      html  css  js  c++  java
  • pipeline step description

     pipeline 有很多提供step的插件, 如 SCM step提供了sh, git操作等step操作

    utility step 插件提供了文件读写压缩等step

    此处对scm step sh label功能进行介绍

    修改前:

        echo 'Hello World'

    给step添加label:

    f方式一:sh script: " echo 'Hello World'", label: "tet it"

    方式二:sh returnStdout: true ,script: "echo hello", label: "aaa"

    方式三:sh(script: "echo hi", returnStdout: true, label: "hixx")

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

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

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

    方式四: 使用labelled-step插件: https://www.jenkins.io/doc/pipeline/steps/labelled-steps/

    https://plugins.jenkins.io/labelled-steps/

    附比对:

    添加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"]
    }]
    }

  • 相关阅读:
    [剑指Offer]59-队列的最大值(题目二待补)
    [Java学习]面向对象-package;内部类;UML图表示六种关系
    已安全化的ActiveX控件卸载时出现"DllUnregisterServer函数出错,错误代码:0x80070002"问题解决
    Win10 启动64位IE浏览器——修改注册表方法
    系统托盘弹出通知或气泡
    LPCTSTR 字符串获取其长度
    ActiveX控件获取不到对象属性或者方法的原因分析
    时钟周期 VS 机器周期
    VS2017 ATL创建ActiveX编程要点
    incremental linking(增量链接)的作用
  • 原文地址:https://www.cnblogs.com/i-shu/p/14965317.html
Copyright © 2011-2022 走看看