mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-14 13:56:47 +00:00
[Ubuntu] Rework podman and tools installation (#5580)
This commit is contained in:
@@ -149,10 +149,14 @@ $toolsList = @(
|
|||||||
|
|
||||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||||
$toolsList += @(
|
$toolsList += @(
|
||||||
(Get-BuildahVersion),
|
|
||||||
(Get-PhantomJSVersion),
|
(Get-PhantomJSVersion),
|
||||||
(Get-LeiningenVersion),
|
(Get-LeiningenVersion),
|
||||||
(Get-HHVMVersion),
|
(Get-HHVMVersion)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (Test-IsUbuntu22) {
|
||||||
|
$toolsList += @(
|
||||||
|
(Get-BuildahVersion),
|
||||||
(Get-PodManVersion),
|
(Get-PodManVersion),
|
||||||
(Get-SkopeoVersion)
|
(Get-SkopeoVersion)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -42,20 +42,17 @@ function Get-CodeQLBundleVersion {
|
|||||||
|
|
||||||
function Get-PodManVersion {
|
function Get-PodManVersion {
|
||||||
$podmanVersion = podman --version | Take-OutputPart -Part 2
|
$podmanVersion = podman --version | Take-OutputPart -Part 2
|
||||||
$aptSourceRepo = Get-AptSourceRepository -PackageName "containers"
|
return "Podman $podmanVersion"
|
||||||
return "Podman $podmanVersion (apt source repository: $aptSourceRepo)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-BuildahVersion {
|
function Get-BuildahVersion {
|
||||||
$buildahVersion = buildah --version | Take-OutputPart -Part 2
|
$buildahVersion = buildah --version | Take-OutputPart -Part 2
|
||||||
$aptSourceRepo = Get-AptSourceRepository -PackageName "containers"
|
return "Buildah $buildahVersion"
|
||||||
return "Buildah $buildahVersion (apt source repository: $aptSourceRepo)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SkopeoVersion {
|
function Get-SkopeoVersion {
|
||||||
$skopeoVersion = skopeo --version | Take-OutputPart -Part 2
|
$skopeoVersion = skopeo --version | Take-OutputPart -Part 2
|
||||||
$aptSourceRepo = Get-AptSourceRepository -PackageName "containers"
|
return "Skopeo $skopeoVersion"
|
||||||
return "Skopeo $skopeoVersion (apt source repository: $aptSourceRepo)"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CMakeVersion {
|
function Get-CMakeVersion {
|
||||||
|
|||||||
@@ -4,25 +4,11 @@
|
|||||||
## Desc: Installs container tools: podman, buildah and skopeo onto the image
|
## Desc: Installs container tools: podman, buildah and skopeo onto the image
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
source $HELPER_SCRIPTS/os.sh
|
|
||||||
|
|
||||||
install_packages=(podman buildah skopeo)
|
install_packages=(podman buildah skopeo)
|
||||||
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable"
|
|
||||||
|
|
||||||
# Install podman, buildah, scopeo container's tools (on Ubuntu20 these tools can be installed without adding new repository)
|
# Install podman, buildah, scopeo container's tools
|
||||||
source /etc/os-release
|
|
||||||
sh -c "echo 'deb ${REPO_URL}/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
|
|
||||||
wget -qnv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
|
|
||||||
apt-key add Release.key
|
|
||||||
apt-get update -qq
|
|
||||||
apt-get -qq -y install ${install_packages[@]}
|
apt-get -qq -y install ${install_packages[@]}
|
||||||
mkdir -p /etc/containers
|
mkdir -p /etc/containers
|
||||||
echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf
|
echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf
|
||||||
|
|
||||||
# Remove source repo
|
|
||||||
rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
|
||||||
|
|
||||||
# Document source repo
|
|
||||||
echo "containers $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
|
|
||||||
|
|
||||||
invoke_tests "Tools" "Containers"
|
invoke_tests "Tools" "Containers"
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ Describe "Rust" {
|
|||||||
$env:RUSTUP_HOME = "/etc/skel/.rustup"
|
$env:RUSTUP_HOME = "/etc/skel/.rustup"
|
||||||
$env:CARGO_HOME = "/etc/skel/.cargo"
|
$env:CARGO_HOME = "/etc/skel/.cargo"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
It "Rustup is installed" {
|
It "Rustup is installed" {
|
||||||
"rustup --version" | Should -ReturnZeroExitCode
|
"rustup --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
@@ -121,7 +120,7 @@ Describe "clang" {
|
|||||||
|
|
||||||
"clang-$ClangVersion --version" | Should -ReturnZeroExitCode
|
"clang-$ClangVersion --version" | Should -ReturnZeroExitCode
|
||||||
"clang++-$ClangVersion --version" | Should -ReturnZeroExitCode
|
"clang++-$ClangVersion --version" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Cmake" {
|
Describe "Cmake" {
|
||||||
@@ -336,7 +335,7 @@ Describe "GraalVM" -Skip:(Test-IsUbuntu18) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "Containers" -Skip:(Test-IsUbuntu22) {
|
Describe "Containers" -Skip:(-not (Test-IsUbuntu22)) {
|
||||||
$testCases = @("podman", "buildah", "skopeo") | ForEach-Object { @{ContainerCommand = $_} }
|
$testCases = @("podman", "buildah", "skopeo") | ForEach-Object { @{ContainerCommand = $_} }
|
||||||
|
|
||||||
It "<ContainerCommand>" -TestCases $testCases {
|
It "<ContainerCommand>" -TestCases $testCases {
|
||||||
@@ -345,7 +344,7 @@ Describe "Containers" -Skip:(Test-IsUbuntu22) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
"$ContainerCommand -v" | Should -ReturnZeroExitCode
|
"$ContainerCommand -v" | Should -ReturnZeroExitCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Describe "nvm" {
|
Describe "nvm" {
|
||||||
|
|||||||
@@ -199,7 +199,6 @@
|
|||||||
"{{template_dir}}/scripts/installers/swift.sh",
|
"{{template_dir}}/scripts/installers/swift.sh",
|
||||||
"{{template_dir}}/scripts/installers/cmake.sh",
|
"{{template_dir}}/scripts/installers/cmake.sh",
|
||||||
"{{template_dir}}/scripts/installers/codeql-bundle.sh",
|
"{{template_dir}}/scripts/installers/codeql-bundle.sh",
|
||||||
"{{template_dir}}/scripts/installers/containers.sh",
|
|
||||||
"{{template_dir}}/scripts/installers/dotnetcore-sdk.sh",
|
"{{template_dir}}/scripts/installers/dotnetcore-sdk.sh",
|
||||||
"{{template_dir}}/scripts/installers/erlang.sh",
|
"{{template_dir}}/scripts/installers/erlang.sh",
|
||||||
"{{template_dir}}/scripts/installers/firefox.sh",
|
"{{template_dir}}/scripts/installers/firefox.sh",
|
||||||
|
|||||||
@@ -200,7 +200,6 @@
|
|||||||
"{{template_dir}}/scripts/installers/swift.sh",
|
"{{template_dir}}/scripts/installers/swift.sh",
|
||||||
"{{template_dir}}/scripts/installers/cmake.sh",
|
"{{template_dir}}/scripts/installers/cmake.sh",
|
||||||
"{{template_dir}}/scripts/installers/codeql-bundle.sh",
|
"{{template_dir}}/scripts/installers/codeql-bundle.sh",
|
||||||
"{{template_dir}}/scripts/installers/containers.sh",
|
|
||||||
"{{template_dir}}/scripts/installers/dotnetcore-sdk.sh",
|
"{{template_dir}}/scripts/installers/dotnetcore-sdk.sh",
|
||||||
"{{template_dir}}/scripts/installers/erlang.sh",
|
"{{template_dir}}/scripts/installers/erlang.sh",
|
||||||
"{{template_dir}}/scripts/installers/firefox.sh",
|
"{{template_dir}}/scripts/installers/firefox.sh",
|
||||||
|
|||||||
@@ -276,6 +276,7 @@ build {
|
|||||||
"${path.root}/scripts/installers/clang.sh",
|
"${path.root}/scripts/installers/clang.sh",
|
||||||
"${path.root}/scripts/installers/cmake.sh",
|
"${path.root}/scripts/installers/cmake.sh",
|
||||||
"${path.root}/scripts/installers/codeql-bundle.sh",
|
"${path.root}/scripts/installers/codeql-bundle.sh",
|
||||||
|
"${path.root}/scripts/installers/containers.sh",
|
||||||
"${path.root}/scripts/installers/dotnetcore-sdk.sh",
|
"${path.root}/scripts/installers/dotnetcore-sdk.sh",
|
||||||
"${path.root}/scripts/installers/gcc.sh",
|
"${path.root}/scripts/installers/gcc.sh",
|
||||||
"${path.root}/scripts/installers/gfortran.sh",
|
"${path.root}/scripts/installers/gfortran.sh",
|
||||||
|
|||||||
Reference in New Issue
Block a user