开发者

Teamcity build loops on successful build

开发者 https://www.devze.com 2022-12-19 23:11 出处:网络
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.

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="Tes开发者_C百科t">
            <Gallio IgnoreFailures="true" Files="@(TestAssemblies)">
                <Output TaskParameter="ExitCode" PropertyName="ExitCode"/> 
            </Gallio> 
    </Target>

</Project>


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号