Unverified Commit 5c67da03 authored by jurjenoskam's avatar jurjenoskam Committed by GitHub

`[azure-cli]`: add `bicepVersion` for use with `installBicep` (#1227)

Add `bicepVersion` parameter (defaulting to `latest`) to optionally
specify a specific Bicep version when `installBicep` is `true`.
Co-authored-by: 's avatarJurjen Oskam <Jurjen.Oskam@rabobank.nl>
Co-authored-by: 's avatarDaniel Doyle <ddoyle2017@github.com>
parent c31723d2
{ {
"id": "azure-cli", "id": "azure-cli",
"version": "1.2.5", "version": "1.2.6",
"name": "Azure CLI", "name": "Azure CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/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.", "description": "Installs the Azure CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
...@@ -23,6 +23,14 @@ ...@@ -23,6 +23,14 @@
"description": "Optionally install Azure Bicep", "description": "Optionally install Azure Bicep",
"default": false "default": false
}, },
"bicepVersion": {
"type": "string",
"proposals": [
"latest"
],
"default": "latest",
"description": "Select or enter a Bicep version. ('latest' or a specic version such as 'v0.31.92')"
},
"installUsingPython": { "installUsingPython": {
"type": "boolean", "type": "boolean",
"description": "Install Azure CLI using Python instead of pipx", "description": "Install Azure CLI using Python instead of pipx",
......
...@@ -15,6 +15,7 @@ rm -rf /var/lib/apt/lists/* ...@@ -15,6 +15,7 @@ rm -rf /var/lib/apt/lists/*
AZ_VERSION=${VERSION:-"latest"} AZ_VERSION=${VERSION:-"latest"}
AZ_EXTENSIONS=${EXTENSIONS} AZ_EXTENSIONS=${EXTENSIONS}
AZ_INSTALLBICEP=${INSTALLBICEP:-false} AZ_INSTALLBICEP=${INSTALLBICEP:-false}
AZ_BICEPVERSION=${BICEPVERSION:-latest}
INSTALL_USING_PYTHON=${INSTALLUSINGPYTHON:-false} INSTALL_USING_PYTHON=${INSTALLUSINGPYTHON:-false}
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
AZCLI_ARCHIVE_ARCHITECTURES="amd64 arm64" AZCLI_ARCHIVE_ARCHITECTURES="amd64 arm64"
...@@ -229,10 +230,16 @@ if [ "${AZ_INSTALLBICEP}" = "true" ]; then ...@@ -229,10 +230,16 @@ if [ "${AZ_INSTALLBICEP}" = "true" ]; then
# The `az bicep install --target-platform` could be a solution; however, linux-arm64 is not an allowed value for this argument yet # The `az bicep install --target-platform` could be a solution; however, linux-arm64 is not an allowed value for this argument yet
# Manually installing Bicep and moving to the appropriate directory where az expects it to be # Manually installing Bicep and moving to the appropriate directory where az expects it to be
if [ "${AZ_BICEPVERSION}" = "latest" ]; then
bicep_download_path="https://github.com/Azure/bicep/releases/latest/download"
else
bicep_download_path="https://github.com/Azure/bicep/releases/download/${AZ_BICEPVERSION}"
fi
if [ "${architecture}" = "arm64" ]; then if [ "${architecture}" = "arm64" ]; then
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-arm64 curl -Lo bicep ${bicep_download_path}/bicep-linux-arm64
else else
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 curl -Lo bicep ${bicep_download_path}/bicep-linux-x64
fi fi
chmod +x ./bicep chmod +x ./bicep
......
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