Teamcity 在成功构建时构建循环

发布于 2024-08-22 01:27:19 字数 2423 浏览 2 评论 0原文

我已经使用 Teamcity 建立了一个构建。请参阅下面我的构建文件。

  • 当构建成功并且测试通过时,构建过程只会在循环中无限期地运行。

    当构建成功并且测试通过时,构建过程只会在循环
  • 当构建失败时,这不会发生。

我尝试首先在构建触发上设置 60 秒暂停,最后完全禁用构建触发。没有区别。

造成这种情况的原因还有哪些?

我的 MSBuild 文件如下所示:

<Project DefaultTargets="Build;Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">    

    <PropertyGroup>
        <DeployDirectory>$(MSBuildProjectDirectory)\..\bin</DeployDirectory>
        <DependencyDirectory>$(MSBuildProjectDirectory)\Dependencies</DependencyDirectory>
        <LinqToSqlMapFolder>$(DeployDirectory)\LinqToSql</LinqToSqlMapFolder>
            <NCoverVersionForMSI>$(BUILD_NUMBER)</NCoverVersionForMSI>
            <NCoverVersionPeriod>$(BUILD_NUMBER)</NCoverVersionPeriod>
    </PropertyGroup>

    <ItemGroup>
        <ProjectFiles Include="**\*.vbproj"/>
        <ConfigFiles Include="**\*.config"/>
        <MapFiles Include="**\*.linqtosql.config"/>
        <TestAssemblies Include="$(DeployDirectory)\*.Test.dll"/>
        <Dependencies Include="$(DependencyDirectory)\**\*" />
    </ItemGroup>

    <Target Name="Clean">
        <MSBuild Projects="@(ProjectFiles)" Targets="Clean"/>   
    </Target>   

    <Target Name="Build">
        <MSBuild Projects="@(ProjectFiles)" Targets="Rebuild">
            <Output TaskParameter="TargetOutputs" ItemName="BuildOutput"/>
        </MSBuild>

        <Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(DeployDirectory)" />
        <Copy SourceFiles="@(Dependencies)" DestinationFolder="$(DeployDirectory)" SkipUnchangedFiles="true" />
        <Copy SourceFiles="@(ConfigFiles)" DestinationFolder="$(DeployDirectory)" SkipUnchangedFiles="true" />
        <Copy SourceFiles="@(MapFiles)" DestinationFolder="$(LinqToSqlMapFolder)" SkipUnchangedFiles="true" />
    </Target>

    <UsingTask AssemblyFile="$(DependencyDirectory)\Gallio\Gallio.MsBuildTasks.dll" TaskName="Gallio" /> 


    <Target Name="Test">
            <Gallio IgnoreFailures="true" Files="@(TestAssemblies)">
                <Output TaskParameter="ExitCode" PropertyName="ExitCode"/> 
            </Gallio> 
    </Target>

</Project>

I have set up a build with Teamcity. See my build file below.

  • When the build is succesful and the tests pass, the build process just runs again and again indefinitely in a loop.

  • When the build fails, this does not happen.

I have tried to first set 60 second pause on buildtriggering, and finally disabled build triggering altogether. No difference.

What else could be the cause of this?

My MSBuild file looks like this:

<Project DefaultTargets="Build;Test" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">    

    <PropertyGroup>
        <DeployDirectory>$(MSBuildProjectDirectory)\..\bin</DeployDirectory>
        <DependencyDirectory>$(MSBuildProjectDirectory)\Dependencies</DependencyDirectory>
        <LinqToSqlMapFolder>$(DeployDirectory)\LinqToSql</LinqToSqlMapFolder>
            <NCoverVersionForMSI>$(BUILD_NUMBER)</NCoverVersionForMSI>
            <NCoverVersionPeriod>$(BUILD_NUMBER)</NCoverVersionPeriod>
    </PropertyGroup>

    <ItemGroup>
        <ProjectFiles Include="**\*.vbproj"/>
        <ConfigFiles Include="**\*.config"/>
        <MapFiles Include="**\*.linqtosql.config"/>
        <TestAssemblies Include="$(DeployDirectory)\*.Test.dll"/>
        <Dependencies Include="$(DependencyDirectory)\**\*" />
    </ItemGroup>

    <Target Name="Clean">
        <MSBuild Projects="@(ProjectFiles)" Targets="Clean"/>   
    </Target>   

    <Target Name="Build">
        <MSBuild Projects="@(ProjectFiles)" Targets="Rebuild">
            <Output TaskParameter="TargetOutputs" ItemName="BuildOutput"/>
        </MSBuild>

        <Copy SourceFiles="@(BuildOutput)" DestinationFolder="$(DeployDirectory)" />
        <Copy SourceFiles="@(Dependencies)" DestinationFolder="$(DeployDirectory)" SkipUnchangedFiles="true" />
        <Copy SourceFiles="@(ConfigFiles)" DestinationFolder="$(DeployDirectory)" SkipUnchangedFiles="true" />
        <Copy SourceFiles="@(MapFiles)" DestinationFolder="$(LinqToSqlMapFolder)" SkipUnchangedFiles="true" />
    </Target>

    <UsingTask AssemblyFile="$(DependencyDirectory)\Gallio\Gallio.MsBuildTasks.dll" TaskName="Gallio" /> 


    <Target Name="Test">
            <Gallio IgnoreFailures="true" Files="@(TestAssemblies)">
                <Output TaskParameter="ExitCode" PropertyName="ExitCode"/> 
            </Gallio> 
    </Target>

</Project>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼波传意 2024-08-29 01:27:19

虽然这似乎不是您的问题,但我自己也遇到了类似的循环问题。我在项目配置中启用了标签。我还使用每 60 秒检查一次修改的规则来触发构建。因此,在成功构建后,TeamCity 会在 VCS 中标记该构建,然后 60 秒后,它会看到(它自己的)修改并触发另一个构建。

为了解决我们的问题,我们只是禁用了标签,因为我们无论如何都不想要它,但您也可以配置一个规则来忽略特定作者,这样它就不会在所做的修改时触发。

While it appears that this wasn't your issue, I ran into a similar looping problem of my own. I had enabled labeling in the project configuration. I was also using a check for modifications every 60 seconds rule to trigger the build. As a result, upon successful build, TeamCity would tag the build in the VCS and then 60 seconds later, it would see (it's own) modification and trigger another build.

To fix our problem, we just disabled labeling because we didn't want it anyways, but you can also configure a rule to ignore particular authors such that it won't trigger on modifications it made.

氛圍 2024-08-29 01:27:19

teamcity 的安装似乎存在一些问题,重新安装后的配置备份使用完全相同的配置和构建脚本解决了该问题。

It appears there were some problems with the install of teamcity, and a backup of configuration following a reinstall solved the problem with exactly same configuration and buildscript.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文