mis*_*hod 21
这就是我最后使用bash脚本执行此操作的方法:
#!/bin/bash
curl -o lastBuild.tmp "http://localhost:8111/app/rest/buildTypes/id:bt2/builds/status:SUCCESS" --user rest:rest
last_commit=`xpath lastBuild.tmp '/build/revisions/revision/@version'| awk -F"\"" '{print $2}'`
echo "##Last commit = $last_commit"
# prepare build notes
NOTES=`git log --pretty=format:"- %s" $last_commit..origin/master`
echo "this is it:$NOTES"
Run Code Online (Sandbox Code Playgroud)
一些解释:
curl从构建配置中获取上次成功的构建.在我的示例中,这是bt2,请务必将其替换为您的git log让所有的变化,形成最后的构建和任何你想要的格式化.我想获得提交说明.您可以使用“从构建步骤添加或更改构建参数”功能来直接从构建步骤更新某些构建参数。
从 GitHub 获取后,您需要一个调用的步骤git log origin/master..master(请参阅“ git:列表提交尚未推送到原点”)。
(有关使用 GitHub 进行 TeamCity 配置,请参阅“将 Team City 与 Git 一起使用”,并确保您的TeamCity 使用正确的帐户运行)
| 归档时间: |
|
| 查看次数: |
4110 次 |
| 最近记录: |