[ubuntu] Refactor bash functions (#9055)

This commit is contained in:
Shamil Mubarakshin
2023-12-26 12:50:52 +01:00
committed by GitHub
parent d16bc5f120
commit 503ae89818
38 changed files with 191 additions and 224 deletions

View File

@@ -9,15 +9,15 @@ source $HELPER_SCRIPTS/os.sh
source $HELPER_SCRIPTS/etc-environment.sh
# Set ImageVersion and ImageOS env variables
setEtcEnvironmentVariable "ImageVersion" "${IMAGE_VERSION}"
setEtcEnvironmentVariable "ImageOS" "${IMAGE_OS}"
set_etc_environment_variable "ImageVersion" "${IMAGE_VERSION}"
set_etc_environment_variable "ImageOS" "${IMAGE_OS}"
# Set the ACCEPT_EULA variable to Y value to confirm your acceptance of the End-User Licensing Agreement
setEtcEnvironmentVariable "ACCEPT_EULA" "Y"
set_etc_environment_variable "ACCEPT_EULA" "Y"
# This directory is supposed to be created in $HOME and owned by user(https://github.com/actions/runner-images/issues/491)
mkdir -p /etc/skel/.config/configstore
setEtcEnvironmentVariable "XDG_CONFIG_HOME" '$HOME/.config'
set_etc_environment_variable "XDG_CONFIG_HOME" '$HOME/.config'
# Change waagent entries to use /mnt for swapfile
sed -i 's/ResourceDisk.Format=n/ResourceDisk.Format=y/g' /etc/waagent.conf
@@ -30,7 +30,7 @@ sed -i 's/::1 ip6-localhost ip6-loopback/::1 localhost ip6-localhost ip6-loo
# Prepare directory and env variable for toolcache
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
mkdir $AGENT_TOOLSDIRECTORY
setEtcEnvironmentVariable "AGENT_TOOLSDIRECTORY" "${AGENT_TOOLSDIRECTORY}"
set_etc_environment_variable "AGENT_TOOLSDIRECTORY" "${AGENT_TOOLSDIRECTORY}"
chmod -R 777 $AGENT_TOOLSDIRECTORY
# https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
@@ -62,6 +62,6 @@ fi
# Disable to load providers
# https://github.com/microsoft/azure-pipelines-agent/issues/3834
if isUbuntu22; then
if is_ubuntu22; then
sed -i 's/openssl_conf = openssl_init/#openssl_conf = openssl_init/g' /etc/ssl/openssl.cnf
fi