从 TeamCity 运行时,Nant 复制任务不会复制
我的 nant 脚本中有以下目标:
<target name="update" verbose="true">
<copy todir="${dirs.deploy}">
<fileset basedir="${dirs.drop}\_PublishedWebSites\RomanceReminder.Web">
<include name="**/*.*" />
</fileset>
</copy>
</target>
当我手动运行此脚本时,日志中可以看到以下输出:
[南特] C:\Projects\RomanceReminder\BuildScripts.Custom_test_deploy.build
构建文件: 文件:///C:/Projects/RomanceReminder/BuildScripts.Custom/_test_deploy.build
目标框架:Microsoft .NET 框架3.5
指定目标:出发
错误检查:
stop_w3svc:
清理:
[echo] 正在删除 C:\Webs\Nightly。
更新:
[复制] 将 93 个文件复制到 'C:\Webs\Nightly'。
启动_w3svc:
去:
构建成功
总时间:2.6秒。
正如您所看到的,它将 93 个文件移动到 web\nightly 文件夹中。
当通过 TeamCity 运行此脚本时,由于某种原因不会发生复制。 Team city 在管理员帐户下运行,因此它应该拥有所需的所有权限。 TC 的日志文件显示了上面的确切文本,但更新任务没有显示任何内容。
有人知道我如何解决这个问题吗?
更新:我翻转了复制任务上的位以提供详细日志记录。 现在我在 TeamCity 日志中看到以下内容:
[复制] 正在将 0 个文件复制到“C:\Webs\Nightly”。
我仍然感到困惑,我可以从命令行运行它并且一切正常,但 TC 不复制文件... 8(
I have the following target in my nant script:
<target name="update" verbose="true">
<copy todir="${dirs.deploy}">
<fileset basedir="${dirs.drop}\_PublishedWebSites\RomanceReminder.Web">
<include name="**/*.*" />
</fileset>
</copy>
</target>
when I run this script manually the following output is visible in the log:
[nant]
C:\Projects\RomanceReminder\BuildScripts.Custom_test_deploy.buildBuildfile:
file:///C:/Projects/RomanceReminder/BuildScripts.Custom/_test_deploy.buildTarget framework: Microsoft .NET
Framework 3.5Target(s) specified: go
error_check:
stop_w3svc:
cleanup:
[echo] Deleting C:\Webs\Nightly.
update:
[copy] Copying 93 files to
'C:\Webs\Nightly'.start_w3svc:
go:
BUILD SUCCEEDED
Total time: 2.6 seconds.
As you can see it move 93 files into the web\nightly folder.
When this script is run via TeamCity the copy doesn't happen for some reason. Team city is running under an admin account so it should have all the permissions it needs. The log file for TC show the exact text above except the update task shows nothing.
Anyone have ideas on how I can even troubleshoot this?
UPDATE: I flipped the bit on the copy task to give verbose logging. and now I see the following in my TeamCity log:
[copy] Copying 0 files to 'C:\Webs\Nightly'.
I still am flummoxed by I can run it from the command line and everything works, but TC doesn't copy files... 8(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
用户错误 用户错误 用户错误
当然,我不相信该工具假设它做错了什么。 放置目录仅在打包步骤中填充。 该特定脚本在此之前执行。 Team City 每次运行时都会销毁构建目录,包括放置目录。 所以南特是正确的,没有文件可以复制。 我修改了我的脚本以使用构建输出,一切都很好。
User Error User Error User Error
Of course, I was not trusting the tool assuming it was doing something wrong. The drop directory is only populated in the package step. This particular script executes before that. Team City destroys the build directory every time it runs including the drop directory. So nant was correct, there were no files to copy. I modified my script to use the build output and all is good with the world.