Skip to content
代码片段 群组 项目
未验证 提交 3707e1a8 编辑于 作者: John Luo's avatar John Luo 提交者: GitHub
浏览文件

Clean up background processes on CI builds (#11151)

Addresses issues where background Java processes causes builds to hang.
Added diagnostics to capture running processes on CI builds.
上级 b0be780f
No related branches found
No related tags found
无相关合并请求
@ECHO OFF
SETLOCAL
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; try { & '%~dp0build.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }"
PowerShell -NoProfile -NoLogo -ExecutionPolicy Bypass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; try { & '%~dp0build.ps1' %*; exit $LASTEXITCODE } catch { write-host $_; exit 1 }"
ECHO build.cmd completed
\ No newline at end of file
......@@ -124,6 +124,9 @@ param(
# MSBuild for .NET Core
[switch]$ForceCoreMsbuild,
# Diagnostics
[switch]$DumpProcesses, # Capture all running processes and dump them to a file.
# Other lifecycle targets
[switch]$Help, # Show help
......@@ -243,6 +246,12 @@ $env:DOTNET_HOME = $DotNetHome
# Execute
if ($DumpProcesses -or $CI)
{
# Dump running processes
Start-Job -Name DumpProcesses -FilePath $PSScriptRoot\eng\scripts\dump_process.ps1 -ArgumentList $PSScriptRoot
}
$korebuildPath = Get-KoreBuild
# Project selection
......@@ -372,4 +381,16 @@ finally {
Remove-Module 'KoreBuild' -ErrorAction Ignore
Remove-Item env:DOTNET_HOME
Remove-Item env:KOREBUILD_KEEPGLOBALJSON
if ($DumpProcesses -or $CI)
{
Stop-Job -Name DumpProcesses
Remove-Job -Name DumpProcesses
}
if ($CI) {
& "$PSScriptRoot/eng/scripts/KillProcesses.ps1"
}
Write-Host "build.ps1 completed"
}
@ECHO OFF
SET RepoRoot=%~dp0..\..
%RepoRoot%\build.cmd -ci -all -pack -sign %*
ECHO cibuild.cmd completed
\ No newline at end of file
Set-Location $args[0]
$timestamp = $(get-date -f MM-dd-HH-mm)
while ($true) {
Get-Process > artifacts/log/runningProcesses.$timestamp.txt
Get-WmiObject Win32_Process | select name, processid, commandline > artifacts/log/runningProcessesCommandLine.$timestamp.txt
Start-Sleep -Seconds 300
}
\ No newline at end of file
@ECHO OFF
SETLOCAL
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' -all -nobuild -restore %*; exit $LASTEXITCODE"
PowerShell -NoProfile -NoLogo -ExecutionPolicy ByPass -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' -all -nobuild -restore %*; exit $LASTEXITCODE"
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册