-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathdocker-build-test.sh
More file actions
executable file
·29 lines (25 loc) · 977 Bytes
/
docker-build-test.sh
File metadata and controls
executable file
·29 lines (25 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
# Test Docker multi-platform build (linux/amd64, 386, arm64, arm/v7, arm/v6)
# Requires: frontend_dist/ (run from repo root after building frontend)
set -e
cd "$(dirname "$0")/.."
echo "==> Preparing frontend_dist..."
if [ ! -d "frontend_dist" ] || [ -z "$(ls -A frontend_dist 2>/dev/null)" ]; then
echo "Building frontend..."
(cd frontend && npm install --prefer-offline --no-audit && npm run build)
rm -rf frontend_dist
mkdir -p frontend_dist
cp -R frontend/dist/* frontend_dist/
echo "frontend_dist ready."
else
echo "frontend_dist exists, skipping frontend build."
fi
PLATFORMS="linux/amd64,linux/386,linux/arm64/v8,linux/arm/v7,linux/arm/v6"
echo "==> Testing Docker build for: $PLATFORMS"
docker buildx build \
--platform "$PLATFORMS" \
-f Dockerfile.frontend-artifact \
--build-arg CRONET_RELEASE=latest \
--progress=plain \
. 2>&1 | tee docker-build-test.log
echo "==> Done. Check docker-build-test.log for full output."