Files
runner-images/images/linux/scripts/installers/post-deployment.sh
Maxim Lobanov 06c90a3200 [Ubuntu] Chmod known directories (#4509)
* chmod known directories

* nit space
2021-11-15 18:35:50 +01:00

30 lines
883 B
Bash

#!/bin/bash -e
################################################################################
## File: post-deployment.sh
## Desc: Post deployment actions
################################################################################
mv -f /imagegeneration/post-generation /opt
echo "chmod -R 777 /opt"
chmod -R 777 /opt
echo "chmod -R 777 /usr/share"
chmod -R 777 /usr/share
echo "chmod -R 777 /home"
chmod -R 777 /home
# remove installer and helper folders
rm -rf $HELPER_SCRIPT_FOLDER
rm -rf $INSTALLER_SCRIPT_FOLDER
chmod 755 $IMAGE_FOLDER
# Remove quotes around PATH
ENVPATH=$(grep 'PATH=' /etc/environment | head -n 1 | sed -z 's/^PATH=*//')
ENVPATH=${ENVPATH#"\""}
ENVPATH=${ENVPATH%"\""}
echo "PATH=$ENVPATH" | sudo tee -a /etc/environment
echo "Updated /etc/environment: $(cat /etc/environment)"
# Clean yarn and npm cache
yarn cache clean
npm cache clean --force