Skip to content

Commit

Permalink
Mark GitLab jobs as interruptable (#70)
Browse files Browse the repository at this point in the history
This will make GitLab cancel jobs when they are no longer relevant (such as a new commit being pushed to a merge request).
  • Loading branch information
hach-que authored Dec 2, 2024
1 parent a621684 commit 33f36dc
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ protected override async Task EmitBuildServerSpecificFileAsync(
job.Variables = new Dictionary<string, string>(sourceJob.EnvironmentVariables);
job.Needs = sourceJob.Agent.IsManual ? new List<string>() : sourceJob.Needs.ToList();

// Ensure that older jobs are stopped when replaced with newer ones.
job.Interruptible = true;

if (sourceJob.Agent.Platform == BuildServerJobPlatform.Windows)
{
job.Tags = new List<string> { "buildgraph-windows" };
Expand Down

0 comments on commit 33f36dc

Please sign in to comment.