mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
resolve comments
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Add well-known SSH host keys to ssh_known_hosts
|
||||
|
||||
ssh-keyscan -t rsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"
|
||||
ssh-keyscan -t dsa github.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"
|
||||
ssh-keyscan -t rsa ssh.dev.azure.com >> "C:\Program Files\Git\etc\ssh\ssh_known_hosts"
|
||||
@@ -1,30 +0,0 @@
|
||||
# Create Rust junction points to cargo and rustup folder
|
||||
$cargoTarget = "$env:USERPROFILE\.cargo"
|
||||
if (-not (Test-Path $cargoTarget))
|
||||
{
|
||||
New-Item -ItemType Junction -Path $cargoTarget -Target "C:\Rust\.cargo"
|
||||
|
||||
if (Test-Path $cargoTarget)
|
||||
{
|
||||
Write-Host "Junction created for $cargoTarget <<===>> C:\Rust\.cargo"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Junction was not created for $cargoTarget"
|
||||
}
|
||||
}
|
||||
|
||||
$rustupTarget = "$env:USERPROFILE\.rustup"
|
||||
if (-not (Test-Path $rustupTarget))
|
||||
{
|
||||
New-Item -ItemType Junction -Path $rustupTarget -Target "C:\Rust\.rustup"
|
||||
|
||||
if (Test-Path $rustupTarget)
|
||||
{
|
||||
Write-Host "Junction created for $rustupTarget <<===>> C:\Rust\.rustup"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Junction was not created for $rustupTarget"
|
||||
}
|
||||
}
|
||||
12
images/win/post-generation/Create-RustJunction.ps1
Normal file
12
images/win/post-generation/Create-RustJunction.ps1
Normal file
@@ -0,0 +1,12 @@
|
||||
# Create Rust junction points to cargo and rustup folder
|
||||
$cargoTarget = "$env:USERPROFILE\.cargo"
|
||||
if (-not (Test-Path $cargoTarget))
|
||||
{
|
||||
New-Item -ItemType Junction -Path $cargoTarget -Target "C:\Rust\.cargo"
|
||||
}
|
||||
|
||||
$rustupTarget = "$env:USERPROFILE\.rustup"
|
||||
if (-not (Test-Path $rustupTarget))
|
||||
{
|
||||
New-Item -ItemType Junction -Path $rustupTarget -Target "C:\Rust\.rustup"
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
# Script to address any current issues with images that could be easily worked around.
|
||||
$ErrorActionPreference="Stop"
|
||||
|
||||
# Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a
|
||||
# Remove 3 registry settings that are left behind when sysprepping. Having those registry settings together with a
|
||||
# race condition that kicks in when trying to run custom scripts extensions and stops us from reimaging machines.
|
||||
# ICM: https://portal.microsofticm.com/imp/v3/incidents/details/191973270/home
|
||||
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'Incarnation' -Force -ErrorAction Ignore
|
||||
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'InVmSvdSeqNo' -Force -ErrorAction Ignore
|
||||
Remove-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure\HandlerState' -Name 'LastGoalStateMethod' -Force -ErrorAction Ignore
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
if ([string]::IsNullOrEmpty($env:RUNNER_TOOL_CACHE))
|
||||
{
|
||||
$env:RUNNER_TOOL_CACHE=$env:AGENT_TOOLSDIRECTORY
|
||||
[System.Environment]::SetEnvironmentVariable('RUNNER_TOOL_CACHE', $env:AGENT_TOOLSDIRECTORY, [System.EnvironmentVariableTarget]::Machine)
|
||||
Write-Host "RUNNER_TOOL_CACHE set to match AGENT_TOOLSDIRECTORY: $env:RUNNER_TOOL_CACHE"
|
||||
|
||||
[System.Environment]::SetEnvironmentVariable('AGENT_TOOLSDIRECTORY', $null, [System.EnvironmentVariableTarget]::Machine)
|
||||
$isAgentToolsDirectoryNotThere = [string]::IsNullOrEmpty($env:RUNNER_TOOL_CACHE)
|
||||
Write-Host "AGENT_TOOLSDIRECTORY deleted: $isAgentToolsDirectoryNotThere"
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "RUNNER_TOOL_CACHE non-empty: $env:RUNNER_TOOL_CACHE"
|
||||
}
|
||||
@@ -1,18 +1,5 @@
|
||||
$isPathUpdated = $false
|
||||
$hgPath = "$Env:ProgramFiles\Mercurial\"
|
||||
$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
if (Test-Path -Path $hgPath)
|
||||
{
|
||||
$latestPath = "$hgPath;$latestPath"
|
||||
Write-Host "Added Mercurial to PATH"
|
||||
$isPathUpdated = $true
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Didn't find Mercurial at $hgPath. Skipping adding PATH to it."
|
||||
}
|
||||
|
||||
$dotnetPath = "$env:USERPROFILE\.dotnet\tools"
|
||||
if ($latestPath.Contains("C:\Users\VssAdministrator\.dotnet\tools"))
|
||||
{
|
||||
@@ -31,9 +18,5 @@ else
|
||||
Write-Host "$dotnetPath already in PATH"
|
||||
}
|
||||
|
||||
if ($isPathUpdated)
|
||||
{
|
||||
[System.Environment]::SetEnvironmentVariable('PATH', $latestPath, [System.EnvironmentVariableTarget]::Machine)
|
||||
}
|
||||
$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
|
||||
Write-Host "Windows PATH: $updatedPath"
|
||||
16
images/win/post-generation/Update-MercurialPath.ps1
Normal file
16
images/win/post-generation/Update-MercurialPath.ps1
Normal file
@@ -0,0 +1,16 @@
|
||||
$hgPath = "$Env:ProgramFiles\Mercurial\"
|
||||
$latestPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
|
||||
|
||||
if (Test-Path -Path $hgPath)
|
||||
{
|
||||
$latestPath = "$hgPath;$latestPath"
|
||||
Write-Host "Added Mercurial to PATH"
|
||||
$isPathUpdated = $true
|
||||
}
|
||||
else
|
||||
{
|
||||
Write-Host "Didn't find Mercurial at $hgPath. Skipping adding PATH to it."
|
||||
}
|
||||
|
||||
$updatedPath = [System.Environment]::GetEnvironmentVariable('PATH', [System.EnvironmentVariableTarget]::Machine)
|
||||
Write-Host "Windows PATH: $updatedPath"
|
||||
Reference in New Issue
Block a user