Skip to content

Commit

Permalink
Kill processes after completing build and before publishing artifacts (
Browse files Browse the repository at this point in the history
…#1059)

- dotnet/aspnetcore-internal#1735
- cherry pick e2bb8ac from `master`
  - change `default-build.yml` instead of `azure-pipelines.yml`
  • Loading branch information
dougbu committed Feb 4, 2019
1 parent e725449 commit 8b72786
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions eng/scripts/KillProcesses.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env pwsh -c
$ErrorActionPreference = 'Continue'

taskkill /T /F /IM dotnet.exe
taskkill /T /F /IM testhost.exe
taskkill /T /F /IM iisexpress.exe
taskkill /T /F /IM iisexpresstray.exe
taskkill /T /F /IM w3wp.exe
taskkill /T /F /IM msbuild.exe
taskkill /T /F /IM vbcscompiler.exe
taskkill /T /F /IM git.exe
taskkill /T /F /IM vctip.exe
taskkill /T /F /IM chrome.exe
iisreset /restart

exit 0
4 changes: 4 additions & 0 deletions eng/scripts/KillProcesses.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

pkill dotnet || true
exit 0
6 changes: 6 additions & 0 deletions eng/templates/default-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ jobs:
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- script: .\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
displayName: Run build.cmd
- powershell: eng\scripts\KillProcesses.ps1
displayName: Kill processes
condition: always()
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: ./build.sh -ci -p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
displayName: Run build.sh
- script: eng/scripts/KillProcesses.sh
displayName: Kill processes
condition: always()
- task: PublishTestResults@2
displayName: Publish test results
condition: always()
Expand Down

0 comments on commit 8b72786

Please sign in to comment.