mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 17:23:37 +08:00
fix(ci): use the Ubuntu Azure archive on Noble and Resolute (#17341)
* fix(ci): use the Ubuntu Azure archive on Resolute * fix(ci): restore Noble archive access
This commit is contained in:
@@ -11,18 +11,23 @@ runs:
|
||||
env:
|
||||
REA_NOBLE_AZURE_FALLBACK: ${{ inputs.noble-azure-fallback }}
|
||||
run: |
|
||||
if [[ "$REA_NOBLE_AZURE_FALLBACK" == 'true' ]]; then
|
||||
. /etc/os-release
|
||||
if [[ "${ID:-}" != ubuntu || "${VERSION_CODENAME:-}" != noble ]]; then
|
||||
echo 'The Azure archive fallback is only configured for Ubuntu Noble' >&2
|
||||
exit 1
|
||||
fi
|
||||
. /etc/os-release
|
||||
if [[ "$REA_NOBLE_AZURE_FALLBACK" == 'true' &&
|
||||
( "${ID:-}" != ubuntu || "${VERSION_CODENAME:-}" != noble ) ]]; then
|
||||
echo 'The Azure archive fallback is only configured for Ubuntu Noble' >&2
|
||||
exit 1
|
||||
fi
|
||||
archive_host=archive.ubuntu.com
|
||||
# Hosted CI has timed out fetching indexes and packages from the standard archive.
|
||||
if [[ "${ID:-}" == ubuntu &&
|
||||
( "${VERSION_CODENAME:-}" == noble || "${VERSION_CODENAME:-}" == resolute ) ]]; then
|
||||
archive_host=azure.archive.ubuntu.com
|
||||
fi
|
||||
# Hosted Ubuntu runners can use Azure or regional EC2 mirrors.
|
||||
sources=(/etc/apt/apt-mirrors.txt /etc/apt/sources.list /etc/apt/sources.list.d/ubuntu.sources)
|
||||
for source in "${sources[@]}"; do
|
||||
if [ -f "$source" ]; then
|
||||
sudo sed -Ei.bak 's|https?://([[:alnum:]-]+\.)*archive\.ubuntu\.com/|https://archive.ubuntu.com/|g' "$source"
|
||||
sudo sed -Ei.bak "s|https?://([[:alnum:]-]+\\.)*archive\\.ubuntu\\.com/|https://${archive_host}/|g" "$source"
|
||||
fi
|
||||
done
|
||||
# Fixture installation needs package indexes, not localized descriptions.
|
||||
|
||||
Reference in New Issue
Block a user