mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ci(ubuntu): use AWS regional mirror for apt in compile workflow
The compile_ubuntu workflow's apt operations talk directly to archive.ubuntu.com, which round-robins across community mirrors that occasionally serve out-of-sync index files mid-sync and break apt update for everyone until the upstream catches up. Apply the same mirror swap as build_deb_package.yml: rewrite the container's apt sources to point at us-west-2.ec2.archive.ubuntu.com before any apt operation runs, so both the inline 'apt update' and the later Tools/setup/ubuntu.sh call benefit from the regional mirror. Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
parent
f77a1a44a0
commit
2798910293
11
.github/workflows/compile_ubuntu.yml
vendored
11
.github/workflows/compile_ubuntu.yml
vendored
@ -38,6 +38,17 @@ jobs:
|
||||
|
||||
- name: Fix git in container
|
||||
run: |
|
||||
# Switch to AWS regional mirrors. runs-on instances are in us-west-2,
|
||||
# and the EC2 archive mirrors are Canonical-operated, region-local,
|
||||
# and sync aggressively. The default archive.ubuntu.com round-robin
|
||||
# sometimes serves out-of-sync index files mid-sync, breaking
|
||||
# apt-get update.
|
||||
if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then
|
||||
sed -i 's|http://archive.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g; s|http://security.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list.d/ubuntu.sources
|
||||
fi
|
||||
if [ -f /etc/apt/sources.list ]; then
|
||||
sed -i 's|http://archive.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g; s|http://security.ubuntu.com/ubuntu|http://us-west-2.ec2.archive.ubuntu.com/ubuntu|g' /etc/apt/sources.list
|
||||
fi
|
||||
# we only need this because we are running the job in a container
|
||||
# when checkout pulls git it does it in a shared volume
|
||||
# and file ownership changes between steps
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user