Skip to content

Commit d3a1032

Browse files
committed
Source trigger: adding quiet period.
1 parent 3782261 commit d3a1032

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/PostSharp.Engineering.BuildTools/ContinuousIntegration/Triggers/SourceBuildTrigger.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
using JetBrains.Annotations;
44
using PostSharp.Engineering.BuildTools.ContinuousIntegration.TeamCity.Arguments;
5+
using System;
56
using System.IO;
67

78
namespace PostSharp.Engineering.BuildTools.ContinuousIntegration.Triggers;
@@ -17,6 +18,8 @@ public class SourceBuildTrigger : IBuildTrigger
1718
public string? BranchFilter { get; init; }
1819

1920
public BuildConfigurationParameter[]? Parameters { get; init; }
21+
22+
public TimeSpan? QuietPeriod { get; init; } = TimeSpan.FromHours( 2 );
2023

2124
public void GenerateTeamcityCode( TextWriter writer, string? branchFilter = null )
2225
{
@@ -33,6 +36,12 @@ void WriteIndented( string text )
3336
branchFilter = this.BranchFilter ?? branchFilter ?? "+:<default>";
3437
WriteIndented( $"branchFilter = \"{branchFilter}\"" );
3538

39+
if ( this.QuietPeriod != null )
40+
{
41+
WriteIndented( " quietPeriodMode = VcsTrigger.QuietPeriodMode.USE_CUSTOM" );
42+
WriteIndented( $" quietPeriod = {this.QuietPeriod.Value.TotalSeconds}" );
43+
}
44+
3645
WriteIndented( "// Build will not trigger automatically if the commit message contains comment value." );
3746
WriteIndented( "triggerRules = \"-:comment=<<VERSION_BUMP>>|<<DEPENDENCIES_UPDATED>>:**\"" );
3847

@@ -51,4 +60,4 @@ void WriteIndented( string text )
5160

5261
writer.WriteLine( " }" );
5362
}
54-
}
63+
}

0 commit comments

Comments
 (0)