美文网首页
修改jenkins job的changelog

修改jenkins job的changelog

作者: 一只老梨花 | 来源:发表于2018-03-19 00:08 被阅读366次

    jenkins change log

    • 1 按照如下格式在build目录里面增加changlog.xml(或者参考其他job的changelog)
    commit ********
    tree ********
    parent *******
    author user<XXX@nokia.com> 2017-11-16 15:22:24 +0800
    committer user<XXX@nokia.com> 2017-11-16 15:22:24 +0800
        test changelog1
        hahahahaha
        test make changelog
    :100644 100644 a08bf856c22076cab9129e9c634dcdd9a356550a 86673c578f418ccecf963294d639975bcb1e3be1 M  XXX.py
    
    • 2 修改build目录下的build.xml scm字段
      <scm class="hudson.plugins.git.GitChangeLogParser" plugin="git@2.4.4">

      <authorOrCommitter>false</authorOrCommitter>

      </scm>

    • 3 用jenkins CLI 命令reload修改的job

    Tips

    • 获取当前job的build目录
    #!/bin/bash
    jenkins_host=$(echo ${JENKINS_URL} |sed -n 's#.*//\(.*\):.*#\1#p')
    scp `whoami`@${jenkins_host}:${JENKINS_HOME}/config.xml .
    tmp_dir=$(cat config.xml | grep "<buildsDir>" | sed -n 's#\(<.*>\)\/\(.*\)\(<.*>\)#/\2#p' ) 
    build_dir=$(eval "echo $tmp_dir")
    rm config.xml
    echo ${build_dir}
    

    相关文章

      网友评论

          本文标题:修改jenkins job的changelog

          本文链接:https://www.haomeiwen.com/subject/qlojqftx.html