我的一个TeamCity v7.0构建项目依赖于在当前开发分支和主分支之间使用diff来确定需要运行的内容.我写了一个小脚本,使用类似的东西:
git diff origin/master..origin/QA --name-only --diff-filter=AM | DoSomethingWithThoseFiles
Run Code Online (Sandbox Code Playgroud)
不幸的是,构建日志表明它git diff不起作用.当我进入这个项目的buildAgent/work目录时,我发现没有.git文件夹,所以它无法执行所需的git操作.
我已经把TW-15873中提到teamcity.git.use.local.mirrors=true的buildAgent.properties文件放入了文件中,但这似乎没有任何帮助.
我可以做些什么来在脚本中为我的构建步骤更改两个分支之间的文件列表?
我在TeamCity @ windows下运行的CI过程中有Rake构建脚本.该脚本执行的一个步骤是将一些更改提交到远程存储库(此存储库代表我的共享主机上的真实生产环境.它只有ftp访问权限,因此我将此位置映射为Windows驱动器)
红宝石的一部分看起来像这样:
sh "git commit -v -m #{version_tag}"
Run Code Online (Sandbox Code Playgroud)
但是,当teamcity构建代理(在LocalSystem帐户下运行)运行脚本时,我收到以下警告:
[master e7a5a8d] v0.4.7.0
Committer: unknown <SYSTEM@.(none)>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
If the identity used for this commit is wrong, you can fix it with:
git commit --amend --author='Your Name <you@example.com>'
9 files changed, …Run Code Online (Sandbox Code Playgroud) 作为我发布构建的构建步骤的一部分,我希望能够访问特定构建的更改日志.特别是git提交消息.
我不确定我是否可以在构建步骤中通过git执行此操作,或者使更改日志成为我可以访问的参数.任何帮助表示赞赏.