CI: mariadb.sh avoids the unreachable Azure apt mirror and retries apt
CI / Test (jest) (pull_request) Successful in 27s
CI / Lint (eslint) (pull_request) Successful in 29s
CI / Security (npm audit) (pull_request) Successful in 24s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 3m7s
CI / Integration (api) (pull_request) Successful in 4m4s
CI / UI screenshots (before/after) (pull_request) Successful in 11s
CI / UI (playwright) (pull_request) Successful in 2m2s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / Test (jest) (pull_request) Successful in 27s
CI / Lint (eslint) (pull_request) Successful in 29s
CI / Security (npm audit) (pull_request) Successful in 24s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 3m7s
CI / Integration (api) (pull_request) Successful in 4m4s
CI / UI screenshots (before/after) (pull_request) Successful in 11s
CI / UI (playwright) (pull_request) Successful in 2m2s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
The Playwright image's apt sources point at azure.archive.ubuntu.com, which timed out from the runner after it moved nodes; the UI job failed at Start MariaDB twice. Switch to archive.ubuntu.com and retry apt up to 3 times. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f140b380fb
commit
61991841aa
1 file changed
+14
-2
+14
-2
@@ -6,8 +6,20 @@
|
||||
set -euo pipefail
|
||||
: "${DB_NAME:?}" "${DB_USER:?}" "${DB_PASSWORD:?}"
|
||||
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends mariadb-server >/dev/null
|
||||
# The Playwright image points apt at Azure's Ubuntu mirror, which our runner can't
|
||||
# always reach; use the main Ubuntu mirror instead, and retry transient failures.
|
||||
for f in /etc/apt/sources.list /etc/apt/sources.list.d/*.list /etc/apt/sources.list.d/*.sources; do
|
||||
[ -f "$f" ] && sed -i 's#http://azure\.archive\.ubuntu\.com/#http://archive.ubuntu.com/#g' "$f"
|
||||
done
|
||||
for attempt in 1 2 3; do
|
||||
if apt-get -o Acquire::Retries=3 update -qq \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 install -y -qq --no-install-recommends mariadb-server >/dev/null; then
|
||||
break
|
||||
fi
|
||||
[ "$attempt" = 3 ] && { echo "::error::could not install mariadb-server"; exit 1; }
|
||||
echo "apt failed (attempt $attempt); retrying in 10s"
|
||||
sleep 10
|
||||
done
|
||||
mkdir -p /run/mysqld && chown mysql:mysql /run/mysqld
|
||||
if ! mariadb-admin ping --silent 2>/dev/null; then
|
||||
(mariadbd --user=mysql --bind-address=127.0.0.1 --port=3306 >/tmp/mariadb.log 2>&1 &)
|
||||
|
||||
Reference in new issue
Block a user