【问题标题】:Finding TeamCity Agent's working path for use in MSBuild script查找 TeamCity Agent 的工作路径以在 MSBuild 脚本中使用
【发布时间】:2009-03-28 17:23:45
【问题描述】:

我想将输出文件从我的构建复制到暂存服务器,但我不知道如何找到 TeamCity 用来在 MSBuild 中存储构建输出的路径。有什么帮助吗?

谢谢!

【问题讨论】:

    标签: msbuild continuous-integration teamcity


    【解决方案1】:

    $(teamcity_build_workingDir) 属性做到了。

    【讨论】:

      【解决方案2】:

      最好的方法是将文件上传到 teamcity。选择 step1(常规设置)并输入工件路径。它应该类似于 /SourceOfProject/bin/releaese/*.dll。

      我在上传之前压缩文件,因为您只想下载 1 个包含完整构建的文件。 我的构建总是在一个 nant 文件中有 2 个步骤。

      Step1 - 调用 msbuild

      Step2 - 使用 7zip 创建 zip

      <?xml version="1.0"?>
      <project name="MyProjectBuild"
       default="build"  basedir="."
       xmlns="http://nant.sf.net/release/0.85/nant.xsd">
      
       <description>Build Script</description>
       <target name="build" >
       <exec program="C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe"    >  
       <arg value="MyProject\MyProject.csproj" />
       <arg value="/t:Build" />
        <arg value="/p:Configuration=Release" />
       </exec>
      
         <exec program="7z"    >  
       <arg value="a" />
       <arg value="MyProject\bin\release\buildresult.zip" />
        <arg value="MyProject\bin\release\*.dll" />
       </exec>
       </target>
      
      </project>
      

      无论如何,我的工作路径是: C:\Programme\TeamCity\buildAgent\work

      【讨论】:

      • 阅读 Artifact Paths 听起来 TeamCity 已经在做我想做的事情,我只需要复制它的文件。谢谢!
      猜你喜欢
      • 1970-01-01
      • 2018-09-02
      • 1970-01-01
      • 1970-01-01
      • 2010-09-15
      • 1970-01-01
      • 2015-02-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多