Skip to content

Commit f5ca141

Browse files
authored
Kill processes after completing build and before publishing test results or artifacts (#7228)
- aspnet/AspNetCore-Internal#1735 - port dotnet/extensions@e2bb8ac1a0 fix into this repo - change `default-build.yml` instead of `azure-pipelines.yml` - make a couple of changes to `KillProcesses.ps1` (which I'll take back to Extensions) - remove `ci-official.yml`
1 parent bb8c6fc commit f5ca141

File tree

4 files changed

+26
-225
lines changed

4 files changed

+26
-225
lines changed

.azure/pipelines/ci-official.yml

Lines changed: 0 additions & 225 deletions
This file was deleted.

.azure/pipelines/jobs/default-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,15 @@ jobs:
121121
- ${{ if eq(parameters.agentOs, 'Windows') }}:
122122
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
123123
displayName: Run build.cmd
124+
- powershell: eng\scripts\KillProcesses.ps1
125+
displayName: Kill processes
126+
condition: always()
124127
- ${{ if ne(parameters.agentOs, 'Windows') }}:
125128
- script: ./$(BuildDirectory)/build.sh -ci -p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
126129
displayName: Run build.sh
130+
- script: eng/scripts/KillProcesses.sh
131+
displayName: Kill processes
132+
condition: always()
127133
- task: PublishTestResults@2
128134
displayName: Publish test results
129135
condition: always()

eng/scripts/KillProcesses.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$ErrorActionPreference = 'Continue'
2+
3+
taskkill /T /F /IM dotnet.exe
4+
taskkill /T /F /IM testhost.exe
5+
taskkill /T /F /IM iisexpress.exe
6+
taskkill /T /F /IM iisexpresstray.exe
7+
taskkill /T /F /IM w3wp.exe
8+
taskkill /T /F /IM msbuild.exe
9+
taskkill /T /F /IM vbcscompiler.exe
10+
taskkill /T /F /IM git.exe
11+
taskkill /T /F /IM vctip.exe
12+
taskkill /T /F /IM chrome.exe
13+
taskkill /T /F /IM h2spec.exe
14+
iisreset /restart
15+
16+
exit 0

eng/scripts/KillProcesses.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
pkill dotnet || true
4+
exit 0

0 commit comments

Comments
 (0)