mirror of
https://github.com/actions/runner-images.git
synced 2025-12-28 04:38:53 +08:00
Merge branch 'main' of https://github.com/actions/virtual-environments into v-llaphin/fix-path
This commit is contained in:
@@ -240,6 +240,17 @@ function Get-CachedDockerImages {
|
||||
return $images
|
||||
}
|
||||
|
||||
function Get-CachedDockerImagesTableData {
|
||||
return (sudo docker images --digests --format "*{{.Repository}}:{{.Tag}}|{{.Digest}} |{{.CreatedAt}}").Split("*") | Where-Object { $_ } | ForEach-Object {
|
||||
$parts=$_.Split("|")
|
||||
[PSCustomObject] @{
|
||||
"Repository:Tag" = $parts[0]
|
||||
"Digest" = $parts[1]
|
||||
"Created" = $parts[2].split(' ')[0]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Get-AptPackages {
|
||||
$toolsetJson = Get-ToolsetContent
|
||||
$apt = $toolsetJson.apt
|
||||
@@ -252,4 +263,4 @@ function Get-PipxVersion {
|
||||
$result -match "(?<version>\d+\.\d+\.\d+\.?\d*)" | Out-Null
|
||||
$pipxVersion = $Matches.Version
|
||||
return "Pipx $pipxVersion"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,8 @@ $markdown += Build-AndroidTable | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
$markdown += New-MDHeader "Cached Docker images" -Level 3
|
||||
$markdown += New-MDList -Style Unordered -Lines @(Get-CachedDockerImages)
|
||||
$markdown += Get-CachedDockerImagesTableData | New-MDTable
|
||||
$markdown += New-MDNewLine
|
||||
|
||||
$markdown += New-MDHeader "Installed apt packages" -Level 3
|
||||
$markdown += New-MDList -Style Unordered -Lines @(Get-AptPackages)
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get -yq update
|
||||
apt-get -yq dist-upgrade
|
||||
|
||||
# Stop and disable apt-daily upgrade services;
|
||||
systemctl stop apt-daily.timer
|
||||
systemctl disable apt-daily.timer
|
||||
@@ -16,7 +12,7 @@ systemctl disable apt-daily-upgrade.service
|
||||
sudo sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/' /etc/apt/apt.conf.d/20auto-upgrades
|
||||
|
||||
# Enable retry logic for apt up to 10 times
|
||||
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries
|
||||
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries
|
||||
|
||||
# Configure apt to always assume Y
|
||||
echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes
|
||||
|
||||
@@ -16,4 +16,7 @@ curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
|
||||
|
||||
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
|
||||
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
|
||||
apt-get update
|
||||
|
||||
# update
|
||||
apt-get -yq update
|
||||
apt-get -yq dist-upgrade
|
||||
|
||||
@@ -18,6 +18,10 @@ pwsh -Command "Update-Module -Name PowerShellGet -Force"
|
||||
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
||||
for version in ${versions[@]}; do
|
||||
pwsh -Command "Save-Module -Name Az -LiteralPath /usr/share/az_$version -RequiredVersion $version -Force -Verbose"
|
||||
if isUbuntu20; then
|
||||
rm -rf "/usr/share/az_$version/Az.Accounts"
|
||||
pwsh -Command "Save-Module -Name Az.Accounts -LiteralPath /usr/share/az_$version -RequiredVersion 1.9.5 -Force -Verbose"
|
||||
fi
|
||||
done
|
||||
|
||||
# Run tests to determine that the software installed as expected
|
||||
|
||||
@@ -9,8 +9,7 @@ source $HELPER_SCRIPTS/os.sh
|
||||
|
||||
# Install Powershell
|
||||
if isUbuntu20 ; then
|
||||
dotnet tool install --tool-path /opt/microsoft/powershell/7 powershell
|
||||
ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
|
||||
snap install powershell --classic --channel=edge/useedge
|
||||
fi
|
||||
|
||||
if isUbuntu16 || isUbuntu18 ; then
|
||||
|
||||
Reference in New Issue
Block a user