Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit a71724c

Browse files
author
CI
committed
Automated update for script library changes
1 parent 15e958b commit a71724c

File tree

10 files changed

+241
-74
lines changed

10 files changed

+241
-74
lines changed

containers/azure-ansible/.devcontainer/library-scripts/azcli-debian.sh

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
set -e
1313

1414
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
15+
AZCLI_ARCHIVE_ARCHITECTURES="amd64"
16+
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
1517

1618
if [ "$(id -u)" -ne 0 ]; then
1719
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
@@ -54,20 +56,21 @@ check_packages() {
5456

5557
export DEBIAN_FRONTEND=noninteractive
5658

57-
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
58-
architecture="$(dpkg --print-architecture)"
59-
if [ "${architecture}" = "amd64" ]; then
59+
install_using_apt() {
6060
# Install dependencies
6161
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
6262
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
63-
. /etc/os-release
6463
get_common_setting MICROSOFT_GPG_KEYS_URI
6564
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
6665
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
67-
apt-get update
68-
apt-get install -y azure-cli
69-
else
70-
echo "No pre-built binaries availabe for ${architecture}. Installing via pip3."
66+
if ! apt-get update && apt-get install -yq azure-cli; then
67+
-f /etc/apt/sources.list.d/azure-cli.list
68+
return 1
69+
fi
70+
}
71+
72+
install_using_pip() {
73+
echo "(*) No pre-built binaries availabe for ${architecture}. Installing via pip3."
7174
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
7275
apt_get_update_if_needed
7376
apt-get -y install python3-minimal python3-pip libffi-dev python3-venv
@@ -84,5 +87,20 @@ else
8487
fi
8588
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' azure-cli
8689
rm -rf /tmp/pip-tmp
90+
}
91+
92+
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
93+
echo "(*) Installing Azure CLI..."
94+
. /etc/os-release
95+
architecture="$(dpkg --print-architecture)"
96+
if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
97+
install_using_apt || use_pip="true"
98+
else
99+
use_pip="true"
87100
fi
101+
102+
if [ "${use_pip}" = "true" ]; then
103+
install_using_pip
104+
fi
105+
88106
echo "Done!"

containers/azure-bicep/.devcontainer/library-scripts/azcli-debian.sh

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
set -e
1313

1414
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
15+
AZCLI_ARCHIVE_ARCHITECTURES="amd64"
16+
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
1517

1618
if [ "$(id -u)" -ne 0 ]; then
1719
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
@@ -54,20 +56,21 @@ check_packages() {
5456

5557
export DEBIAN_FRONTEND=noninteractive
5658

57-
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
58-
architecture="$(dpkg --print-architecture)"
59-
if [ "${architecture}" = "amd64" ]; then
59+
install_using_apt() {
6060
# Install dependencies
6161
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
6262
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
63-
. /etc/os-release
6463
get_common_setting MICROSOFT_GPG_KEYS_URI
6564
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
6665
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
67-
apt-get update
68-
apt-get install -y azure-cli
69-
else
70-
echo "No pre-built binaries availabe for ${architecture}. Installing via pip3."
66+
if ! apt-get update && apt-get install -yq azure-cli; then
67+
-f /etc/apt/sources.list.d/azure-cli.list
68+
return 1
69+
fi
70+
}
71+
72+
install_using_pip() {
73+
echo "(*) No pre-built binaries availabe for ${architecture}. Installing via pip3."
7174
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
7275
apt_get_update_if_needed
7376
apt-get -y install python3-minimal python3-pip libffi-dev python3-venv
@@ -84,5 +87,20 @@ else
8487
fi
8588
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' azure-cli
8689
rm -rf /tmp/pip-tmp
90+
}
91+
92+
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
93+
echo "(*) Installing Azure CLI..."
94+
. /etc/os-release
95+
architecture="$(dpkg --print-architecture)"
96+
if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
97+
install_using_apt || use_pip="true"
98+
else
99+
use_pip="true"
87100
fi
101+
102+
if [ "${use_pip}" = "true" ]; then
103+
install_using_pip
104+
fi
105+
88106
echo "Done!"

containers/azure-cli/.devcontainer/library-scripts/azcli-debian.sh

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
set -e
1313

1414
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
15+
AZCLI_ARCHIVE_ARCHITECTURES="amd64"
16+
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
1517

1618
if [ "$(id -u)" -ne 0 ]; then
1719
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
@@ -54,20 +56,21 @@ check_packages() {
5456

5557
export DEBIAN_FRONTEND=noninteractive
5658

57-
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
58-
architecture="$(dpkg --print-architecture)"
59-
if [ "${architecture}" = "amd64" ]; then
59+
install_using_apt() {
6060
# Install dependencies
6161
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
6262
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
63-
. /etc/os-release
6463
get_common_setting MICROSOFT_GPG_KEYS_URI
6564
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
6665
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
67-
apt-get update
68-
apt-get install -y azure-cli
69-
else
70-
echo "No pre-built binaries availabe for ${architecture}. Installing via pip3."
66+
if ! apt-get update && apt-get install -yq azure-cli; then
67+
-f /etc/apt/sources.list.d/azure-cli.list
68+
return 1
69+
fi
70+
}
71+
72+
install_using_pip() {
73+
echo "(*) No pre-built binaries availabe for ${architecture}. Installing via pip3."
7174
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
7275
apt_get_update_if_needed
7376
apt-get -y install python3-minimal python3-pip libffi-dev python3-venv
@@ -84,5 +87,20 @@ else
8487
fi
8588
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' azure-cli
8689
rm -rf /tmp/pip-tmp
90+
}
91+
92+
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
93+
echo "(*) Installing Azure CLI..."
94+
. /etc/os-release
95+
architecture="$(dpkg --print-architecture)"
96+
if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
97+
install_using_apt || use_pip="true"
98+
else
99+
use_pip="true"
87100
fi
101+
102+
if [ "${use_pip}" = "true" ]; then
103+
install_using_pip
104+
fi
105+
88106
echo "Done!"

containers/azure-terraform/.devcontainer/library-scripts/azcli-debian.sh

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
set -e
1313

1414
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
15+
AZCLI_ARCHIVE_ARCHITECTURES="amd64"
16+
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
1517

1618
if [ "$(id -u)" -ne 0 ]; then
1719
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
@@ -54,20 +56,21 @@ check_packages() {
5456

5557
export DEBIAN_FRONTEND=noninteractive
5658

57-
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
58-
architecture="$(dpkg --print-architecture)"
59-
if [ "${architecture}" = "amd64" ]; then
59+
install_using_apt() {
6060
# Install dependencies
6161
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
6262
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
63-
. /etc/os-release
6463
get_common_setting MICROSOFT_GPG_KEYS_URI
6564
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
6665
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
67-
apt-get update
68-
apt-get install -y azure-cli
69-
else
70-
echo "No pre-built binaries availabe for ${architecture}. Installing via pip3."
66+
if ! apt-get update && apt-get install -yq azure-cli; then
67+
-f /etc/apt/sources.list.d/azure-cli.list
68+
return 1
69+
fi
70+
}
71+
72+
install_using_pip() {
73+
echo "(*) No pre-built binaries availabe for ${architecture}. Installing via pip3."
7174
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
7275
apt_get_update_if_needed
7376
apt-get -y install python3-minimal python3-pip libffi-dev python3-venv
@@ -84,5 +87,20 @@ else
8487
fi
8588
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' azure-cli
8689
rm -rf /tmp/pip-tmp
90+
}
91+
92+
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
93+
echo "(*) Installing Azure CLI..."
94+
. /etc/os-release
95+
architecture="$(dpkg --print-architecture)"
96+
if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
97+
install_using_apt || use_pip="true"
98+
else
99+
use_pip="true"
87100
fi
101+
102+
if [ "${use_pip}" = "true" ]; then
103+
install_using_pip
104+
fi
105+
88106
echo "Done!"

containers/codespaces-linux/.devcontainer/library-scripts/azcli-debian.sh

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
set -e
1313

1414
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
15+
AZCLI_ARCHIVE_ARCHITECTURES="amd64"
16+
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
1517

1618
if [ "$(id -u)" -ne 0 ]; then
1719
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
@@ -54,20 +56,21 @@ check_packages() {
5456

5557
export DEBIAN_FRONTEND=noninteractive
5658

57-
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
58-
architecture="$(dpkg --print-architecture)"
59-
if [ "${architecture}" = "amd64" ]; then
59+
install_using_apt() {
6060
# Install dependencies
6161
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
6262
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
63-
. /etc/os-release
6463
get_common_setting MICROSOFT_GPG_KEYS_URI
6564
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
6665
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
67-
apt-get update
68-
apt-get install -y azure-cli
69-
else
70-
echo "No pre-built binaries availabe for ${architecture}. Installing via pip3."
66+
if ! apt-get update && apt-get install -yq azure-cli; then
67+
-f /etc/apt/sources.list.d/azure-cli.list
68+
return 1
69+
fi
70+
}
71+
72+
install_using_pip() {
73+
echo "(*) No pre-built binaries availabe for ${architecture}. Installing via pip3."
7174
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
7275
apt_get_update_if_needed
7376
apt-get -y install python3-minimal python3-pip libffi-dev python3-venv
@@ -84,5 +87,20 @@ else
8487
fi
8588
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' azure-cli
8689
rm -rf /tmp/pip-tmp
90+
}
91+
92+
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
93+
echo "(*) Installing Azure CLI..."
94+
. /etc/os-release
95+
architecture="$(dpkg --print-architecture)"
96+
if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
97+
install_using_apt || use_pip="true"
98+
else
99+
use_pip="true"
87100
fi
101+
102+
if [ "${use_pip}" = "true" ]; then
103+
install_using_pip
104+
fi
105+
88106
echo "Done!"

containers/codespaces-linux/.devcontainer/library-scripts/git-lfs-debian.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,13 @@ install_using_apt() {
137137
get_common_setting GIT_LFS_ARCHIVE_GPG_KEY_URI
138138
curl -sSL "${GIT_LFS_ARCHIVE_GPG_KEY_URI}" | gpg --dearmor > /usr/share/keyrings/gitlfs-archive-keyring.gpg
139139
echo -e "deb [arch=${architecture} signed-by=/usr/share/keyrings/gitlfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/${ID} ${VERSION_CODENAME} main\ndeb-src [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/gitlfs-archive-keyring.gpg] https://packagecloud.io/github/git-lfs/${ID} ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/git-lfs.list
140-
apt-get install -yq git-lfs${version_suffix} || return 1
141-
git lfs install --skip-repo
140+
141+
if ! apt-get update && apt-get install -yq git-lfs${version_suffix}; then
142+
rm -f /etc/apt/sources.list.d/git-lfs.list
143+
return 1
144+
fi
145+
146+
git-lfs install --skip-repo
142147
}
143148

144149
install_using_github() {

containers/dapr-dotnet/.devcontainer/library-scripts/azcli-debian.sh

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
set -e
1313

1414
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
15+
AZCLI_ARCHIVE_ARCHITECTURES="amd64"
16+
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch buster bullseye bionic focal"
1517

1618
if [ "$(id -u)" -ne 0 ]; then
1719
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
@@ -54,20 +56,21 @@ check_packages() {
5456

5557
export DEBIAN_FRONTEND=noninteractive
5658

57-
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
58-
architecture="$(dpkg --print-architecture)"
59-
if [ "${architecture}" = "amd64" ]; then
59+
install_using_apt() {
6060
# Install dependencies
6161
check_packages apt-transport-https curl ca-certificates gnupg2 dirmngr
6262
# Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install
63-
. /etc/os-release
6463
get_common_setting MICROSOFT_GPG_KEYS_URI
6564
curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg
6665
echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list
67-
apt-get update
68-
apt-get install -y azure-cli
69-
else
70-
echo "No pre-built binaries availabe for ${architecture}. Installing via pip3."
66+
if ! apt-get update && apt-get install -yq azure-cli; then
67+
-f /etc/apt/sources.list.d/azure-cli.list
68+
return 1
69+
fi
70+
}
71+
72+
install_using_pip() {
73+
echo "(*) No pre-built binaries availabe for ${architecture}. Installing via pip3."
7174
if ! dpkg -s python3-minimal python3-pip libffi-dev python3-venv > /dev/null 2>&1; then
7275
apt_get_update_if_needed
7376
apt-get -y install python3-minimal python3-pip libffi-dev python3-venv
@@ -84,5 +87,20 @@ else
8487
fi
8588
${pipx_bin} install --system-site-packages --pip-args '--no-cache-dir --force-reinstall' azure-cli
8689
rm -rf /tmp/pip-tmp
90+
}
91+
92+
# See if we're on x86_64 and if so, install via apt-get, otherwise use pip3
93+
echo "(*) Installing Azure CLI..."
94+
. /etc/os-release
95+
architecture="$(dpkg --print-architecture)"
96+
if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
97+
install_using_apt || use_pip="true"
98+
else
99+
use_pip="true"
87100
fi
101+
102+
if [ "${use_pip}" = "true" ]; then
103+
install_using_pip
104+
fi
105+
88106
echo "Done!"

0 commit comments

Comments
 (0)