2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
2021-03-15 11:17:57 +03:00
|
|
|
# Set ImageVersion and ImageOS env variables
|
2020-03-13 00:12:02 +03:00
|
|
|
echo ImageVersion=$IMAGE_VERSION | tee -a /etc/environment
|
|
|
|
|
echo ImageOS=$IMAGE_OS | tee -a /etc/environment
|
2020-03-12 23:46:11 +03:00
|
|
|
|
2021-03-15 11:17:57 +03:00
|
|
|
# Set the ACCEPT_EULA variable to Y value to confirm your acceptance of the End-User Licensing Agreement
|
|
|
|
|
echo ACCEPT_EULA=Y | tee -a /etc/environment
|
|
|
|
|
|
2020-03-12 23:46:11 +03:00
|
|
|
# This directory is supposed to be created in $HOME and owned by user(https://github.com/actions/virtual-environments/issues/491)
|
|
|
|
|
mkdir -p /etc/skel/.config/configstore
|
2021-03-26 18:33:51 +03:00
|
|
|
echo 'XDG_CONFIG_HOME=$HOME/.config' | tee -a /etc/environment
|
2020-06-04 15:09:41 +03:00
|
|
|
|
2020-06-18 22:13:09 +03:00
|
|
|
# Change waagent entries to use /mnt for swapfile
|
|
|
|
|
sed -i 's/ResourceDisk.Format=n/ResourceDisk.Format=y/g' /etc/waagent.conf
|
|
|
|
|
sed -i 's/ResourceDisk.EnableSwap=n/ResourceDisk.EnableSwap=y/g' /etc/waagent.conf
|
|
|
|
|
sed -i 's/ResourceDisk.SwapSizeMB=0/ResourceDisk.SwapSizeMB=4096/g' /etc/waagent.conf
|
|
|
|
|
|
2020-06-25 18:56:42 +03:00
|
|
|
# Add localhost alias to ::1 IPv6
|
|
|
|
|
sed -i 's/::1 ip6-localhost ip6-loopback/::1 localhost ip6-localhost ip6-loopback/g' /etc/hosts
|
|
|
|
|
|
2020-06-04 15:09:41 +03:00
|
|
|
# Prepare directory and env variable for toolcache
|
|
|
|
|
AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache
|
|
|
|
|
mkdir $AGENT_TOOLSDIRECTORY
|
|
|
|
|
echo "AGENT_TOOLSDIRECTORY=$AGENT_TOOLSDIRECTORY" | tee -a /etc/environment
|
|
|
|
|
chmod -R 777 $AGENT_TOOLSDIRECTORY
|
2020-08-21 18:59:49 +03:00
|
|
|
|
|
|
|
|
# https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
|
|
|
|
|
# https://www.suse.com/support/kb/doc/?id=000016692
|
2020-10-07 13:49:40 +05:00
|
|
|
echo 'vm.max_map_count=262144' | tee -a /etc/sysctl.conf
|
2020-12-30 09:57:11 +03:00
|
|
|
|
|
|
|
|
# Create symlink for tests running
|
|
|
|
|
chmod +x $HELPER_SCRIPTS/invoke-tests.sh
|
|
|
|
|
ln -s $HELPER_SCRIPTS/invoke-tests.sh /usr/local/bin/invoke_tests
|