Unverified Commit fdbd9b47 authored by sireeshajonnalagadda's avatar sireeshajonnalagadda Committed by GitHub

common-utils Azure linux 3 support (#1310)

* added tdnf package manager and some checks for Azure linux

* added tdnf package manager and some checks for Azure linux

* modified install_cmd

* modified install_cmd

---------
Co-authored-by: 's avatarDaniel Doyle <ddoyle2017@github.com>
parent 87befbc7
...@@ -31,6 +31,8 @@ fi ...@@ -31,6 +31,8 @@ fi
if [ "${ID}" = "alpine" ]; then if [ "${ID}" = "alpine" ]; then
apk add --no-cache bash apk add --no-cache bash
fi fi
if [ "${ID}" = "azurelinux" ]; then
tdnf install -y curl git
fi
exec /bin/bash "$(dirname $0)/main.sh" "$@" exec /bin/bash "$(dirname $0)/main.sh" "$@"
exit $? exit $?
...@@ -161,12 +161,18 @@ install_redhat_packages() { ...@@ -161,12 +161,18 @@ install_redhat_packages() {
local package_list="" local package_list=""
local remove_epel="false" local remove_epel="false"
local install_cmd=microdnf local install_cmd=microdnf
if ! type microdnf > /dev/null 2>&1; then if type microdnf > /dev/null 2>&1; then
install_cmd=microdnf
elif type tdnf > /dev/null 2>&1; then
install_cmd=tdnf
elif type dnf > /dev/null 2>&1; then
install_cmd=dnf install_cmd=dnf
if ! type dnf > /dev/null 2>&1; then elif type yum > /dev/null 2>&1; then
install_cmd=yum install_cmd=yum
fi else
fi echo "Unable to find 'tdnf', 'dnf', or 'yum' package manager. Exiting."
exit 1
fi
if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
package_list="${package_list} \ package_list="${package_list} \
...@@ -344,7 +350,7 @@ chmod +x /etc/profile.d/00-restore-env.sh ...@@ -344,7 +350,7 @@ chmod +x /etc/profile.d/00-restore-env.sh
# Get an adjusted ID independent of distro variants # Get an adjusted ID independent of distro variants
if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then if [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then
ADJUSTED_ID="debian" ADJUSTED_ID="debian"
elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then elif [[ "${ID}" = "rhel" || "${ID}" = "fedora" || "${ID}" = "azurelinux" || "${ID}" = "mariner" || "${ID_LIKE}" = *"rhel"* || "${ID_LIKE}" = *"fedora"* || "${ID_LIKE}" = *"mariner"* ]]; then
ADJUSTED_ID="rhel" ADJUSTED_ID="rhel"
VERSION_CODENAME="${ID}${VERSION_ID}" VERSION_CODENAME="${ID}${VERSION_ID}"
elif [ "${ID}" = "alpine" ]; then elif [ "${ID}" = "alpine" ]; then
......
#!/bin/bash
set -e
# Optional: Import test library
source dev-container-features-test-lib
# Load Linux distribution info
. /etc/os-release
# Check if the current user is root
check "root user" test "$(whoami)" = "root"
# Check if the Linux distro is Azure Linux
check "azurelinux distro" test "$ID" = "azurelinux"
# Definition specific tests
check "curl" curl --version
check "jq" jq --version
# Report result
reportResults
...@@ -292,5 +292,11 @@ ...@@ -292,5 +292,11 @@
"features": { "features": {
"common-utils": {} "common-utils": {}
} }
},
"Azure-linux-CU": {
"image": "mcr.microsoft.com/dotnet/sdk:8.0-azurelinux3.0",
"features": {
"common-utils": {}
}
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment