Unverified Commit b98f5a16 authored by Gaurav Saini's avatar Gaurav Saini Committed by GitHub

[az-cli] - To separate the two methods of installation - using apt, using python (#922)

* [az-cli] - To separate the two methods of installation - apt & python

* bump patch version

* changes as requested by review comments

* no need to keep

* added test script missing

* changes for review comment
parent e7dd9faf
{
"id": "azure-cli",
"version": "1.2.3",
"version": "1.2.4",
"name": "Azure CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/azure-cli",
"description": "Installs the Azure CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
......
......@@ -15,7 +15,7 @@ rm -rf /var/lib/apt/lists/*
AZ_VERSION=${VERSION:-"latest"}
AZ_EXTENSIONS=${EXTENSIONS}
AZ_INSTALLBICEP=${INSTALLBICEP:-false}
INSTALL_USING_PYTHON=${INSTALL_USING_PYTHON:-false}
INSTALL_USING_PYTHON=${INSTALLUSINGPYTHON:-false}
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
AZCLI_ARCHIVE_ARCHITECTURES="amd64 arm64"
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch bookworm buster bullseye bionic focal jammy"
......@@ -188,13 +188,15 @@ echo "(*) Installing Azure CLI..."
. /etc/os-release
architecture="$(dpkg --print-architecture)"
CACHED_AZURE_VERSION="${AZ_VERSION}" # In case we need to fallback to pip and the apt path has modified the AZ_VERSION variable.
if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
install_using_apt || use_pip="true"
if [ "${INSTALL_USING_PYTHON}" != "true" ]; then
if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
install_using_apt || use_pip="true"
fi
else
use_pip="true"
fi
if [ "${use_pip}" = "true" ]; then
if [ "${use_pip}" = "true" ]; then
AZ_VERSION=${CACHED_AZURE_VERSION}
install_using_pip_strategy
......
#!/bin/bash
set -e
# Import test library for `check` command
source dev-container-features-test-lib
# Check to make sure the user is vscode
check "user is vscode" whoami | grep vscode
check "version" az --version
echo -e "\n\n🔄 Testing 'O.S'"
if cat /etc/os-release | grep -q 'PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"'; then
echo -e "\n\n✅ Passed 'O.S is Linux 11 (bullseye)'!"
else
echo -e "\n\n❌ Failed 'O.S is other than Linux 11 (bullseye)'!"
fi
# Report result
reportResults
\ No newline at end of file
......@@ -5,17 +5,17 @@ set -e
# Import test library for `check` command
source dev-container-features-test-lib
# Check to make sure the user is vscode
check "user is vscode" whoami | grep vscode
check "version" az --version
echo -e "\n\n🔄 Testing 'O.S'"
echo -e "\n🔄 Testing 'O.S'"
if cat /etc/os-release | grep -q 'PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"'; then
echo -e "\n\n✅ Passed 'O.S is Linux 12 (bookworm)'!"
echo -e "\n✅ Passed 'O.S is Linux 12 (bookworm)'!\n"
else
echo -e "\n\n❌ Failed 'O.S is other than Linux 12 (bookworm)'!"
echo -e "\n❌ Failed 'O.S is other than Linux 12 (bookworm)'!\n"
fi
# Check to make sure the user is vscode
check "user is vscode" whoami | grep vscode
check "version" az --version
# Report result
reportResults
\ No newline at end of file
......@@ -47,5 +47,15 @@
"version": "latest"
}
}
},
"install_using_python_with_python_3_11_bullseye": {
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
"user": "vscode",
"features": {
"azure-cli": {
"version": "latest",
"installUsingPython": "true"
}
}
}
}
\ 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