1

我的 nant 脚本中有以下目标:

<target name="update" verbose="true">
     <copy todir="${dirs.deploy}">
      <fileset basedir="${dirs.drop}\_PublishedWebSites\RomanceReminder.Web">
        <include name="**/*.*" />
      </fileset>
    </copy>
  </target>

当我手动运行此脚本时,日志中会显示以下输出:

[nant] C:\Projects\RomanceReminder\BuildScripts.Custom_test_deploy.build

构建文件:file:///C:/Projects/RomanceReminder/BuildScripts.Custom/_test_deploy.build

目标框架:Microsoft .NET Framework 3.5

指定的目标:去

错误检查:

stop_w3svc:

清理:

[回声] 删除 C:\Webs\Nightly。

更新:

[复制] 将 93 个文件复制到 'C:\Webs\Nightly'。

start_w3svc:

去:

构建成功

总时间:2.6 秒。

如您所见,它将 93 个文件移动到 web\nightly 文件夹中。

当此脚本通过 TeamCity 运行时,由于某种原因不会发生复制。Team city 在管理员帐户下运行,因此它应该具有所需的所有权限。TC 的日志文件显示了上面的确切文本,但更新任务没有显示任何内容。

有人对我如何解决这个问题有任何想法吗?

更新:我翻转了复制任务的位以提供详细的日志记录。现在我在 TeamCity 日志中看到以下内容:

[复制] 将 0 个文件复制到“C:\Webs\Nightly”。

我仍然感到困惑,因为我可以从命令行运行它并且一切正常,但是 TC 不复制文件...... 8(

4

1 回答 1

3

用户错误 用户错误 用户错误

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.

于 2009-07-30T18:10:45.580 回答