mirror of
https://github.com/actions/runner-images.git
synced 2025-12-19 00:06:57 +00:00
add reboot for Ubuntu20
This commit is contained in:
@@ -1,9 +1,5 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
apt-get -yq update
|
|
||||||
apt-get -yq dist-upgrade
|
|
||||||
|
|
||||||
# Stop and disable apt-daily upgrade services;
|
# Stop and disable apt-daily upgrade services;
|
||||||
systemctl stop apt-daily.timer
|
systemctl stop apt-daily.timer
|
||||||
systemctl disable apt-daily.timer
|
systemctl disable apt-daily.timer
|
||||||
@@ -16,7 +12,7 @@ systemctl disable apt-daily-upgrade.service
|
|||||||
sudo sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/' /etc/apt/apt.conf.d/20auto-upgrades
|
sudo sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/' /etc/apt/apt.conf.d/20auto-upgrades
|
||||||
|
|
||||||
# Enable retry logic for apt up to 10 times
|
# Enable retry logic for apt up to 10 times
|
||||||
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries
|
echo "APT::Acquire::Retries \"10\";" > /etc/apt/apt.conf.d/80-retries
|
||||||
|
|
||||||
# Configure apt to always assume Y
|
# Configure apt to always assume Y
|
||||||
echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes
|
echo "APT::Get::Assume-Yes \"true\";" > /etc/apt/apt.conf.d/90assumeyes
|
||||||
|
|||||||
@@ -16,4 +16,7 @@ curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
|
|||||||
|
|
||||||
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
|
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
|
||||||
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
|
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
|
||||||
apt-get update
|
|
||||||
|
# update
|
||||||
|
apt-get -yq update
|
||||||
|
apt-get -yq dist-upgrade
|
||||||
|
|||||||
@@ -72,6 +72,9 @@
|
|||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"script": "{{template_dir}}/scripts/base/apt.sh",
|
"script": "{{template_dir}}/scripts/base/apt.sh",
|
||||||
|
"environment_vars": [
|
||||||
|
"DEBIAN_FRONTEND=noninteractive"
|
||||||
|
],
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,6 +75,9 @@
|
|||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"script": "{{template_dir}}/scripts/base/apt.sh",
|
"script": "{{template_dir}}/scripts/base/apt.sh",
|
||||||
|
"environment_vars": [
|
||||||
|
"DEBIAN_FRONTEND=noninteractive"
|
||||||
|
],
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,9 +74,20 @@
|
|||||||
],
|
],
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"expect_disconnect": true,
|
||||||
|
"scripts": [
|
||||||
|
"{{template_dir}}/scripts/base/reboot.sh"
|
||||||
|
],
|
||||||
|
"execute_command": "/bin/sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"script": "{{template_dir}}/scripts/base/apt.sh",
|
"script": "{{template_dir}}/scripts/base/apt.sh",
|
||||||
|
"environment_vars": [
|
||||||
|
"DEBIAN_FRONTEND=noninteractive"
|
||||||
|
],
|
||||||
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user