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

  • 相关阅读:
    JavaScript AMD 模块加载器原理与实现
    nodejs之日志管理
    实时监测每秒上行下行流量,一款 iOS Today Widget 监测器Demo,还可以可以监测内存大小、存储空间等信息
    Swift 2.0基本语法
    【京东助手】滑稽东试用助手 V1.6.0
    我也秀秀windows phone版博客园客户端
    asp.net做的网站账号登陆后注销不管用了
    分享个自己做的CSDN刷下载积分软件
    推荐一个很好用的HTTP操作类
    新软件马上就要完成了,先发篇文章YY下
  • 原文地址:https://www.cnblogs.com/i-shu/p/14965317.html
Copyright © 2011-2022 走看看