mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 12:06:59 +00:00
This reverts commit ffe7e6a514.
This commit is contained in:
@@ -19,13 +19,6 @@ if command -v journalctl; then
|
|||||||
journalctl --vacuum-time=1s
|
journalctl --vacuum-time=1s
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove redundant folders from azcli
|
|
||||||
if [[ -z "${AZURE_CONFIG_DIR}" ]]; then
|
|
||||||
rm -rf $AZURE_CONFIG_DIR/logs
|
|
||||||
rm -rf $AZURE_CONFIG_DIR/commands
|
|
||||||
rm -rf $AZURE_CONFIG_DIR/telemetry
|
|
||||||
fi
|
|
||||||
|
|
||||||
# delete all .gz and rotated file
|
# delete all .gz and rotated file
|
||||||
find /var/log -type f -regex ".*\.gz$" -delete
|
find /var/log -type f -regex ".*\.gz$" -delete
|
||||||
find /var/log -type f -regex ".*\.[0-9]$" -delete
|
find /var/log -type f -regex ".*\.[0-9]$" -delete
|
||||||
|
|||||||
@@ -4,40 +4,12 @@
|
|||||||
## Desc: Install Azure CLI (az)
|
## Desc: Install Azure CLI (az)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Source the helpers for use with the script
|
|
||||||
source $HELPER_SCRIPTS/etc-environment.sh
|
|
||||||
|
|
||||||
# AZURE_CONFIG_DIR shell variable defines where the CLI configuration file for managing behavior are stored
|
|
||||||
# https://learn.microsoft.com/en-us/cli/azure/azure-cli-configuration#cli-configuration-file
|
|
||||||
# This path SHOULD be different from the installation directory /opt/az/
|
|
||||||
export AZURE_CONFIG_DIR="/opt/az-config"
|
|
||||||
mkdir -p $AZURE_CONFIG_DIR
|
|
||||||
set_etc_environment_variable "AZURE_CONFIG_DIR" "${AZURE_CONFIG_DIR}"
|
|
||||||
|
|
||||||
# AZURE_EXTENSION_DIR shell variable defines where modules are installed
|
|
||||||
# https://docs.microsoft.com/en-us/cli/azure/azure-cli-extensions-overview
|
|
||||||
# This path SHOULD be different from the installation directory /opt/az/
|
|
||||||
export AZURE_EXTENSION_DIR="/opt/az-extension"
|
|
||||||
mkdir -p $AZURE_EXTENSION_DIR
|
|
||||||
set_etc_environment_variable "AZURE_EXTENSION_DIR" "${AZURE_EXTENSION_DIR}"
|
|
||||||
|
|
||||||
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
||||||
curl -fsSL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
curl -fsSL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
||||||
|
|
||||||
echo "azure-cli https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt" >> $HELPER_SCRIPTS/apt-sources.txt
|
echo "azure-cli https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt" >> $HELPER_SCRIPTS/apt-sources.txt
|
||||||
|
|
||||||
# Remove Azure CLI repository (instructions taken from https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt#uninstall-azure-cli)
|
rm -f /etc/apt/sources.list.d/azure-cli.list
|
||||||
rm -f /etc/apt/sources.list.d/azure-cli.sources
|
rm -f /etc/apt/sources.list.d/azure-cli.list.save
|
||||||
|
|
||||||
echo "Warmup 'az'"
|
|
||||||
az --help > /dev/null
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Command 'az --help' failed"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Hand over the ownership of the directories and files to the non-root user
|
|
||||||
chown -R "$SUDO_USER:$SUDO_USER" $AZURE_CONFIG_DIR
|
|
||||||
chown -R "$SUDO_USER:$SUDO_USER" $AZURE_EXTENSION_DIR
|
|
||||||
|
|
||||||
invoke_tests "CLI.Tools" "Azure CLI"
|
invoke_tests "CLI.Tools" "Azure CLI"
|
||||||
|
|||||||
@@ -4,6 +4,14 @@
|
|||||||
## Desc: Install Azure DevOps CLI (az devops)
|
## Desc: Install Azure DevOps CLI (az devops)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
# Source the helpers for use with the script
|
||||||
|
source $HELPER_SCRIPTS/etc-environment.sh
|
||||||
|
|
||||||
|
# AZURE_EXTENSION_DIR shell variable defines where modules are installed
|
||||||
|
# https://docs.microsoft.com/en-us/cli/azure/azure-cli-extensions-overview
|
||||||
|
export AZURE_EXTENSION_DIR=/opt/az/azcliextensions
|
||||||
|
set_etc_environment_variable "AZURE_EXTENSION_DIR" "${AZURE_EXTENSION_DIR}"
|
||||||
|
|
||||||
# install azure devops Cli extension
|
# install azure devops Cli extension
|
||||||
az extension add -n azure-devops
|
az extension add -n azure-devops
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user