我有在 TeamCity@windows 下运行的 CI 进程的 Rake 构建脚本。脚本执行的步骤之一是向远程存储库提交一些更改(此存储库代表我共享主机上的真实生产环境。它只有 ftp 访问权限,因此我将此位置映射为 Windows 驱动器)
红宝石的一部分看起来像这样:
sh "git commit -v -m #{version_tag}"
但是,当脚本由 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, 0 insertions(+), 0 deletions(-)
阅读所写的内容,我将 rake 脚本命令更改为:
sh "git commit --author='TeamCity <no@email.com>' -v -m #{version_tag}"
但是这个命令会导致一个奇怪的失败(之前提交是成功的,但是有警告)。这是我从 TeamCity 构建日志中得到的唯一输出:
git commit --author='TeamCity <no@email.com>' -v -m v1.0.18.10
[19:06:20]: [Execute _3_deployment_stage:to_ftp] The system cannot find the file specified.
如何为在 LocalSystem 帐户下运行的脚本成功设置作者?