mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 20:56:47 +00:00
Move linux provision scripts to virtual-environments (#1714)
* add linux-related scripts from MMS provisioner * removed EOL * removed Ubuntu condition * moved PATH checking to cleanup section * add clarification for cgroups names * names alignment * removed memory-configuration and agent specific scripts * renamed folder to psot-generation, added template instructions * moved key import to git installation * moved PATH check to post-deployment instead of cleanup script * add scripts * output tests file * add startup logic * add powershell module for furute helpers * removed unused modules * copy to tmp folder because of permissions, copy to opt on post-generation step * removed Pester test * change post-generation location * incorrect if statement Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
This commit is contained in:
11
images/linux/post-generation/homebrew-permissions.sh
Normal file
11
images/linux/post-generation/homebrew-permissions.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Fix permissions for Homebrew
|
||||||
|
# https://github.com/actions/virtual-environments/issues/1568
|
||||||
|
brew_folder="/home/linuxbrew/"
|
||||||
|
if [ -d "$brew_folder" ]; then
|
||||||
|
brew_folder_owner=$(ls -ld $brew_folder | awk '{print $3}')
|
||||||
|
if [ "$USER" != "$brew_folder_owner" ]; then
|
||||||
|
chown "$USER":docker -R $brew_folder
|
||||||
|
fi
|
||||||
|
fi
|
||||||
11
images/linux/post-generation/rust-permissions.sh
Normal file
11
images/linux/post-generation/rust-permissions.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Fix permissions for the Rust folder
|
||||||
|
# https://github.com/actions/virtual-environments/issues/572
|
||||||
|
rust_folder="/usr/share/rust"
|
||||||
|
if [ -d "$rust_folder" ]; then
|
||||||
|
rust_folder_owner=$(ls -ld $rust_folder | awk '{print $3}')
|
||||||
|
if [ "$USER" != "$rust_folder_owner" ]; then
|
||||||
|
chown "$USER":docker -R $rust_folder
|
||||||
|
fi
|
||||||
|
fi
|
||||||
@@ -52,3 +52,7 @@ else
|
|||||||
echo "[!] Hub CLI was not installed"
|
echo "[!] Hub CLI was not installed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Add well-known SSH host keys to known_hosts
|
||||||
|
ssh-keyscan -t rsa github.com >> /etc/ssh/ssh_known_hosts
|
||||||
|
ssh-keyscan -t rsa ssh.dev.azure.com >> /etc/ssh/ssh_known_hosts
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
## Desc: Post deployment actions
|
## Desc: Post deployment actions
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
mv -f /imagegeneration/post-generation /opt
|
||||||
|
|
||||||
# set chmod -R 777 /opt
|
# set chmod -R 777 /opt
|
||||||
if [[ -d "/opt" ]]; then
|
if [[ -d "/opt" ]]; then
|
||||||
echo "chmod -R 777 /opt"
|
echo "chmod -R 777 /opt"
|
||||||
@@ -14,3 +16,11 @@ fi
|
|||||||
rm -rf $HELPER_SCRIPT_FOLDER
|
rm -rf $HELPER_SCRIPT_FOLDER
|
||||||
rm -rf $INSTALLER_SCRIPT_FOLDER
|
rm -rf $INSTALLER_SCRIPT_FOLDER
|
||||||
chmod 755 $IMAGE_FOLDER
|
chmod 755 $IMAGE_FOLDER
|
||||||
|
|
||||||
|
# Check PATH
|
||||||
|
if [[ $PATH == \"*\" ]]
|
||||||
|
then
|
||||||
|
echo "ERROR: PATH contains quotes"
|
||||||
|
echo "PATH = $PATH"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -89,6 +89,11 @@
|
|||||||
"source": "{{template_dir}}/scripts/installers",
|
"source": "{{template_dir}}/scripts/installers",
|
||||||
"destination": "{{user `installer_script_folder`}}"
|
"destination": "{{user `installer_script_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{ template_dir }}/post-generation",
|
||||||
|
"destination": "{{user `image_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
|
|||||||
@@ -92,6 +92,11 @@
|
|||||||
"source": "{{template_dir}}/scripts/installers",
|
"source": "{{template_dir}}/scripts/installers",
|
||||||
"destination": "{{user `installer_script_folder`}}"
|
"destination": "{{user `installer_script_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{ template_dir }}/post-generation",
|
||||||
|
"destination": "{{user `image_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
|
|||||||
@@ -94,6 +94,11 @@
|
|||||||
"source": "{{template_dir}}/scripts/installers",
|
"source": "{{template_dir}}/scripts/installers",
|
||||||
"destination": "{{user `installer_script_folder`}}"
|
"destination": "{{user `installer_script_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{ template_dir }}/post-generation",
|
||||||
|
"destination": "{{user `installer_script_folder`}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
|
|||||||
Reference in New Issue
Block a user