Files
runner-images/images/ubuntu/scripts/build/configure-system.sh
T

41 lines
1.2 KiB
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-09-21 11:18:28 +03:00
################################################################################
2023-11-22 21:49:23 +01:00
## File: configure-system.sh
## Desc: Post deployment system configuration actions
2020-09-21 11:18:28 +03:00
################################################################################
source $HELPER_SCRIPT_FOLDER/etc-environment.sh
source $HELPER_SCRIPT_FOLDER/os.sh
mv -f /imagegeneration/post-generation /opt
2021-11-15 18:35:50 +01:00
echo "chmod -R 777 /opt"
chmod -R 777 /opt
echo "chmod -R 777 /usr/share"
chmod -R 777 /usr/share
chmod 755 $IMAGE_FOLDER
2020-11-03 15:56:49 +03:00
# Remove quotes around PATH
2020-11-05 22:08:19 +03:00
ENVPATH=$(grep 'PATH=' /etc/environment | head -n 1 | sed -z 's/^PATH=*//')
2020-11-05 10:36:01 +03:00
ENVPATH=${ENVPATH#"\""}
ENVPATH=${ENVPATH%"\""}
replace_etc_environment_variable "PATH" "${ENVPATH}"
2020-11-05 10:36:01 +03:00
echo "Updated /etc/environment: $(cat /etc/environment)"
2020-10-27 17:24:59 +03:00
2024-03-14 10:53:11 +01:00
# Clean yarn and npm cache
2023-12-29 12:36:27 +01:00
if yarn --version > /dev/null; then
yarn cache clean
fi
2023-12-29 12:36:27 +01:00
if npm --version; then
npm cache clean --force
fi
if is_ubuntu24; then
# Prevent needrestart from restarting the provisioner service.
# Currently only happens on Ubuntu 24.04, so make it conditional for the time being
# as configuration is too different between Ubuntu versions.
sed -i '/^\s*};/i \ qr(^runner-provisioner) => 0,' /etc/needrestart/needrestart.conf
fi