Kill processes after completing build and before publishing test results or artifacts (#7228)
- aspnet/AspNetCore-Internal#1735 - port aspnet/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`
This commit is contained in:
parent
bb8c6fcd46
commit
f5ca141e9d
|
|
@ -1,225 +0,0 @@
|
||||||
trigger:
|
|
||||||
branches:
|
|
||||||
include:
|
|
||||||
- master
|
|
||||||
- release/*
|
|
||||||
exclude:
|
|
||||||
- release/2.0
|
|
||||||
|
|
||||||
phases:
|
|
||||||
- phase: Windows
|
|
||||||
queue:
|
|
||||||
name: DotNetCore-Windows
|
|
||||||
timeoutInMinutes: 120
|
|
||||||
matrix:
|
|
||||||
Release:
|
|
||||||
BuildConfiguration: Release
|
|
||||||
variables:
|
|
||||||
CI: true
|
|
||||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
|
||||||
|
|
||||||
# This variable is required by MicroBuildSigningPlugin to determine permissions for codesigning.
|
|
||||||
TeamName: AspNetCore
|
|
||||||
|
|
||||||
# SignType = { test, real }
|
|
||||||
# This is prefixed underscore because variables automatically become environment variables (and therefore MSBuild properties),
|
|
||||||
# and this one was causing issues in MSBuild projects which use the $(SignType) MSbuild prop.
|
|
||||||
_SignType: real
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- task: NodeTool@0
|
|
||||||
displayName: Install Node 10.x
|
|
||||||
inputs:
|
|
||||||
versionSpec: 10.x
|
|
||||||
- task: MicroBuildSigningPlugin@1
|
|
||||||
displayName: Install MicroBuild plugin
|
|
||||||
condition: and(succeeded(), in(variables['_SignType'], 'test', 'real'))
|
|
||||||
inputs:
|
|
||||||
signType: $(_SignType)
|
|
||||||
zipSources: false
|
|
||||||
# TODO: configure build.cmd to build both x64 and x86 in one invocation
|
|
||||||
- script: build.cmd -ci /p:SkipTests=true /p:Configuration=$(BuildConfiguration) /p:BuildNumber=$(Build.BuildNumber) /t:Build /t:BuildSharedFx /p:SharedFxRID=win-x64 /t:BuildFallbackArchive
|
|
||||||
displayName: Build NuGet packages and win-x64 runtime
|
|
||||||
- script: build.cmd -ci /p:SkipTests=true /p:Configuration=$(BuildConfiguration) /p:BuildNumber=$(Build.BuildNumber) /t:BuildSharedFx /p:SharedFxRID=win-x86
|
|
||||||
displayName: Build win-x86 runtime
|
|
||||||
- powershell: >
|
|
||||||
src/Installers/Windows/clone_and_build_ancm.ps1
|
|
||||||
-GitCredential '$(dn-bot-devdiv-build-rw-code-rw)'
|
|
||||||
-Config $(BuildConfiguration)
|
|
||||||
-BuildNumber $(Build.BuildNumber)
|
|
||||||
-SignType $(_SignType)
|
|
||||||
displayName: Build ANCM installers
|
|
||||||
# TODO: configure harvesting to run as a part of build.cmd so we don't need a hard-coded version here.
|
|
||||||
- powershell: >
|
|
||||||
src/Installers/Windows/build.ps1
|
|
||||||
-x64 artifacts/runtime/aspnetcore-runtime-internal-2.1.6-servicing-$(Build.BuildNumber)-win-x64.zip
|
|
||||||
-x86 artifacts/runtime/aspnetcore-runtime-internal-2.1.6-servicing-$(Build.BuildNumber)-win-x86.zip
|
|
||||||
-Config $(BuildConfiguration)
|
|
||||||
-BuildNumber $(Build.BuildNumber)
|
|
||||||
-SignType $(_SignType)
|
|
||||||
displayName: Build Windows installers
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
displayName: Publish test results
|
|
||||||
condition: always()
|
|
||||||
inputs:
|
|
||||||
testRunner: vstest
|
|
||||||
testResultsFiles: 'artifacts/logs/**/*.trx'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload artifacts
|
|
||||||
condition: eq(variables['system.pullrequest.isfork'], false)
|
|
||||||
inputs:
|
|
||||||
pathtoPublish: ./artifacts/
|
|
||||||
artifactName: artifacts-Windows-Release
|
|
||||||
artifactType: Container
|
|
||||||
# Detect OSS Components in use in the product. Only needs to run on one OS in the matrix.
|
|
||||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
|
||||||
displayName: 'Component Detection'
|
|
||||||
inputs:
|
|
||||||
# This funky GUID represents the product "ASP.NET and EF Core"
|
|
||||||
governanceProduct: 'c641993b-8380-e811-80c3-0004ffb4789e'
|
|
||||||
snapshotForceEnabled: true
|
|
||||||
- task: MicroBuildCleanup@1
|
|
||||||
displayName: Cleanup MicroBuild tasks
|
|
||||||
condition: always()
|
|
||||||
|
|
||||||
- phase: macOS
|
|
||||||
dependsOn: Windows
|
|
||||||
queue:
|
|
||||||
name: Hosted macOS Preview
|
|
||||||
matrix:
|
|
||||||
Release:
|
|
||||||
BuildConfiguration: Release
|
|
||||||
variables:
|
|
||||||
CI: true
|
|
||||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
|
||||||
steps:
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: Download artifacts
|
|
||||||
inputs:
|
|
||||||
artifactName: artifacts-Windows-Release
|
|
||||||
downloadPath: $(Build.SourcesDirectory)/.deps
|
|
||||||
itemPattern: '**/*.nupkg'
|
|
||||||
# Workaround https://github.com/Microsoft/vsts-tasks/issues/6739
|
|
||||||
- task: CopyFiles@2
|
|
||||||
displayName: Copy package assets to correct folder
|
|
||||||
inputs:
|
|
||||||
sourceFolder: $(Build.SourcesDirectory)/.deps/artifacts-Windows-Release
|
|
||||||
targetFolder: $(Build.SourcesDirectory)/.deps
|
|
||||||
- script: >
|
|
||||||
./build.sh
|
|
||||||
--ci
|
|
||||||
/t:Prepare
|
|
||||||
/t:Restore
|
|
||||||
/t:GeneratePropsFiles
|
|
||||||
/t:BuildSharedFx
|
|
||||||
/p:SharedFxRID=osx-x64
|
|
||||||
/p:BuildNumber=$(Build.BuildNumber)
|
|
||||||
displayName: Build osx-x64 runtime
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
displayName: Publish test results
|
|
||||||
condition: always()
|
|
||||||
inputs:
|
|
||||||
testRunner: vstest
|
|
||||||
testResultsFiles: 'artifacts/logs/**/*.trx'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload artifacts
|
|
||||||
condition: eq(variables['system.pullrequest.isfork'], false)
|
|
||||||
inputs:
|
|
||||||
pathtoPublish: ./artifacts/
|
|
||||||
artifactName: artifacts-macOS-Release
|
|
||||||
artifactType: Container
|
|
||||||
|
|
||||||
- phase: Linux
|
|
||||||
dependsOn:
|
|
||||||
- Windows
|
|
||||||
- macOS
|
|
||||||
queue:
|
|
||||||
name: DotNetCore-Linux
|
|
||||||
matrix:
|
|
||||||
Release:
|
|
||||||
BuildConfiguration: Release
|
|
||||||
variables:
|
|
||||||
CI: true
|
|
||||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
|
||||||
steps:
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: Download artifacts
|
|
||||||
inputs:
|
|
||||||
artifactName: artifacts-Windows-Release
|
|
||||||
downloadPath: $(Build.SourcesDirectory)/.deps
|
|
||||||
itemPattern: '**/*.nupkg'
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: Download Windows artifacts
|
|
||||||
inputs:
|
|
||||||
artifactName: artifacts-Windows-Release
|
|
||||||
downloadPath: $(Build.SourcesDirectory)/.r
|
|
||||||
itemPattern: '**/aspnetcore-runtime-*'
|
|
||||||
- task: DownloadBuildArtifacts@0
|
|
||||||
displayName: Download macOS artifacts
|
|
||||||
inputs:
|
|
||||||
artifactName: artifacts-macOS-Release
|
|
||||||
downloadPath: $(Build.SourcesDirectory)/.r
|
|
||||||
itemPattern: '**/aspnetcore-runtime-*'
|
|
||||||
# Workaround https://github.com/Microsoft/vsts-tasks/issues/6739
|
|
||||||
- task: CopyFiles@2
|
|
||||||
displayName: Copy package assets to correct folder
|
|
||||||
inputs:
|
|
||||||
sourceFolder: $(Build.SourcesDirectory)/.deps/artifacts-Windows-Release
|
|
||||||
targetFolder: $(Build.SourcesDirectory)/.deps
|
|
||||||
# TODO: Make the cumulative zips build in their own step
|
|
||||||
- task: CopyFiles@2
|
|
||||||
displayName: Copy package assets to correct folder
|
|
||||||
inputs:
|
|
||||||
sourceFolder: $(Build.SourcesDirectory)/.r/artifacts-Windows-Release
|
|
||||||
targetFolder: $(Build.SourcesDirectory)/artifacts/
|
|
||||||
- task: CopyFiles@2
|
|
||||||
displayName: Copy package assets to correct folder
|
|
||||||
inputs:
|
|
||||||
sourceFolder: $(Build.SourcesDirectory)/.r/artifacts-macOS-Release
|
|
||||||
targetFolder: $(Build.SourcesDirectory)/artifacts/
|
|
||||||
- script: >
|
|
||||||
./build.sh
|
|
||||||
--ci
|
|
||||||
/t:Prepare
|
|
||||||
/t:Restore
|
|
||||||
/t:GeneratePropsFiles
|
|
||||||
/t:BuildSharedFx
|
|
||||||
/p:SharedFxRID=linux-x64
|
|
||||||
/p:BuildNumber=$(Build.BuildNumber)
|
|
||||||
displayName: Build linux-x64 runtime
|
|
||||||
- script: >
|
|
||||||
./build.sh
|
|
||||||
--ci
|
|
||||||
/t:BuildSharedFx
|
|
||||||
/p:SharedFxRID=linux-arm
|
|
||||||
/p:BuildNumber=$(Build.BuildNumber)
|
|
||||||
displayName: Build linux-arm runtime
|
|
||||||
- script: >
|
|
||||||
./dockerbuild.sh
|
|
||||||
alpine
|
|
||||||
/t:Prepare
|
|
||||||
/t:GeneratePropsFiles
|
|
||||||
/t:BuildSharedFx
|
|
||||||
/p:SharedFxRID=linux-musl-x64
|
|
||||||
/p:BuildNumber=$(Build.BuildNumber)
|
|
||||||
displayName: Build linux-musl-x64 runtime
|
|
||||||
# TODO: configure installers to run in one build.sh invocation
|
|
||||||
- script: >
|
|
||||||
./build.sh
|
|
||||||
--ci
|
|
||||||
/t:BuildInstallers
|
|
||||||
/p:_SharedFxSourceDir=$(Build.SourcesDirectory)/artifacts/runtime/
|
|
||||||
displayName: Build linux installers
|
|
||||||
- task: PublishTestResults@2
|
|
||||||
displayName: Publish test results
|
|
||||||
condition: always()
|
|
||||||
inputs:
|
|
||||||
testRunner: vstest
|
|
||||||
testResultsFiles: 'artifacts/logs/**/*.trx'
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
displayName: Upload artifacts
|
|
||||||
condition: eq(variables['system.pullrequest.isfork'], false)
|
|
||||||
inputs:
|
|
||||||
pathtoPublish: ./artifacts/
|
|
||||||
artifactName: artifacts-Linux-Release
|
|
||||||
artifactType: Container
|
|
||||||
|
|
@ -121,9 +121,15 @@ jobs:
|
||||||
- ${{ if eq(parameters.agentOs, 'Windows') }}:
|
- ${{ if eq(parameters.agentOs, 'Windows') }}:
|
||||||
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
|
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
|
||||||
displayName: Run build.cmd
|
displayName: Run build.cmd
|
||||||
|
- powershell: eng\scripts\KillProcesses.ps1
|
||||||
|
displayName: Kill processes
|
||||||
|
condition: always()
|
||||||
- ${{ if ne(parameters.agentOs, 'Windows') }}:
|
- ${{ if ne(parameters.agentOs, 'Windows') }}:
|
||||||
- script: ./$(BuildDirectory)/build.sh -ci -p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
|
- script: ./$(BuildDirectory)/build.sh -ci -p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
|
||||||
displayName: Run build.sh
|
displayName: Run build.sh
|
||||||
|
- script: eng/scripts/KillProcesses.sh
|
||||||
|
displayName: Kill processes
|
||||||
|
condition: always()
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
displayName: Publish test results
|
displayName: Publish test results
|
||||||
condition: always()
|
condition: always()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
$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
|
||||||
|
taskkill /T /F /IM h2spec.exe
|
||||||
|
iisreset /restart
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
pkill dotnet || true
|
||||||
|
exit 0
|
||||||
Loading…
Reference in New Issue