You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31-13Lines changed: 31 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,8 +9,9 @@
9
9
**Feedback and high-quality pull requests are highly welcome!**
10
10
11
11
1.[What is it?](#what-is-it)
12
-
1.[Installation](#installation)
13
-
1.[Usage](#usage)
12
+
1.[Usage as GitHub Action](#github_action)
13
+
1.[Usage on the commandline](#cli)
14
+
1.[Installation](#installation)
14
15
1.[`current` command](#current-command)
15
16
1.[`find` command](#find-command)
16
17
1.[`set` command](#set-command)
@@ -24,10 +25,31 @@
24
25
on [Debian](https://www.debian.org/), [Ubuntu](https://ubuntu.com/), [Pop!_OS](https://pop.system76.com/) systems.
25
26
26
27
It was born out of the ongoing stability [issues](https://github.com/actions/runner-images/issues?q=is%3Aissue+azure.archive.ubuntu.com) with the `azure.archive.ubuntu.com` Ubuntu
27
-
mirror pre-configured in Github Actions runners.
28
+
mirror pre-configured in GitHub Actions runners.
29
+
30
+
31
+
## <aname="github_action"></a>Usage as GitHub Action
32
+
33
+
```yaml
34
+
name: Build
35
+
on: [ push, pull_request ]
36
+
jobs:
37
+
build:
38
+
runs-on: ubuntu-latest
39
+
steps:
40
+
- name: Configure Fast APT Mirror
41
+
uses: vegardit/fast-apt-mirror.sh@v1
42
+
with: # the following parameters are listed with their action default values and are optional
43
+
healthchecks: 20# Number of mirrors from the mirrors list to check for availability and up-to-dateness
44
+
speedtests: 10# Maximum number of healthy mirrors to test for speed
45
+
parallel: 2# Number of parallel speed tests
46
+
sample-size: 1024# Number of kilobytes to download during the speed from each mirror
47
+
sample-time: 3# Maximum number of seconds within the sample download from a mirror must finish
--apply - Replaces the current APT mirror in /etc/apt/sources.list with a fast mirror and runs 'sudo apt-get update'
99
+
--apply - Replaces the current APT mirror in /etc/apt/(sources.list|sources.list.d/system.sources) with a fast mirror and runs 'sudo apt-get update'
82
100
--exclude-current - If specified, don't include the current APT mirror in the speed tests.
83
-
-p, --parallel N - Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster.
84
-
--healthchecks N - Number of mirrors from the Ubuntu/Debian mirror lists to check for availability and up-to-dateness - default is 20
101
+
--healthchecks N - Number of mirrors from the mirrors list to check for availability and up-to-dateness - default is 20
85
102
--speedtests N - Maximum number of healthy mirrors to test for speed - default is 5
103
+
-p, --parallel N - Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster.
86
104
--sample-size KB - Number of kilobytes to download during the speed from each mirror - default is 200KB
87
105
--sample-time SECS - Maximum number of seconds within the sample download from a mirror must finish - default is 3
88
106
-v, --verbose - More output. Specify multiple times to increase verbosity.
description: Configures a fast APT mirror in Ubuntu runners, e.g. in case azure.archive.ubuntu.com is slow or unreachable.
8
+
author: Vegard IT GmbH (https://vegardit.com)
9
+
branding:
10
+
color: blue
11
+
icon: settings
12
+
13
+
inputs:
14
+
healthchecks: { default: "20", description: "Number of mirrors from the mirrors list to check for availability and up-to-dateness." }
15
+
speedtests: { default: "10", description: "Maximum number of healthy mirrors to test for speed." }
16
+
parallel: { default: "2", description: "Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster." }
17
+
sample-size: { default: "1024", description: "Number of kilobytes to download during the speed from each mirror." }
18
+
sample-time: { default: "3", description: "Maximum number of seconds within the sample download from a mirror must finish." }
Copy file name to clipboardExpand all lines: fast-apt-mirror.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -196,9 +196,9 @@ function find_fast_mirror() {
196
196
echo"Options:"
197
197
echo" --apply - Replaces the current APT mirror in /etc/apt/(sources.list|sources.list.d/system.sources) with a fast mirror and runs 'sudo apt-get update'"
198
198
echo" --exclude-current - If specified, don't include the current APT mirror in the speed tests."
199
-
echo" -p, --parallel N - Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster."
200
199
echo" --healthchecks N - Number of mirrors from the mirrors list to check for availability and up-to-dateness - default is 20"
201
200
echo" --speedtests N - Maximum number of healthy mirrors to test for speed - default is 5"
201
+
echo" -p, --parallel N - Number of parallel speed tests. May result in incorrect results because of competing connections but finds a suitable mirror faster."
202
202
echo" --sample-size KB - Number of kilobytes to download during the speed from each mirror - default is 200KB"
203
203
echo" --sample-time SECS - Maximum number of seconds within the sample download from a mirror must finish - default is 3"
204
204
echo" -v, --verbose - More output. Specify multiple times to increase verbosity."
0 commit comments