Skip to content

Commit

Permalink
[Ubuntu] put snapd auto refresh on hold (#4768)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhailkoliada authored Dec 19, 2021
1 parent 459c5d1 commit d2c5a46
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions images/linux/scripts/base/snap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash -e

# Put snapd auto refresh on hold
# as it may generate too much traffic on Canonical's snap server
# when they are rolling a new major update out.
# Hold is calculated as today's date + 60 days

snap set system refresh.hold="$(date --date='today+60 days' +%Y-%m-%dT%H:%M:%S%:z)"
5 changes: 5 additions & 0 deletions images/linux/ubuntu1804.json
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@
"script": "{{template_dir}}/scripts/base/apt-mock-remove.sh",
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"script": "{{template_dir}}/scripts/base/snap.sh",
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"inline": [
Expand Down
5 changes: 5 additions & 0 deletions images/linux/ubuntu2004.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@
"script": "{{template_dir}}/scripts/base/apt-mock-remove.sh",
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"script": "{{template_dir}}/scripts/base/snap.sh",
"execute_command": "sudo sh -c '{{ .Vars }} {{ .Path }}'"
},
{
"type": "shell",
"inline": [
Expand Down

0 comments on commit d2c5a46

Please sign in to comment.