Build optimization: pre-built PM3 binaries, ARM64 CI, base image caching
Replace PM3 compile-from-source in pi-gen with pre-built tarball extraction (saves 43-58 min). Merge stagePM3 into stageDangerousPi as 02-pm3-install substage, renumber all subsequent substages. Switch CI PM3 build to native ARM64 runner (ubuntu-24.04-arm64) eliminating QEMU overhead. Add weekly base-image workflow for pre-baking stages 0-2. Support PM3_TARBALL, BASE_IMAGE, and APT_PROXY env vars in build-image.sh. Also includes prior Phase 5 work: theme system, design system integration, component update system, OS updates, CI build pipeline, and test results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
42
ci/build-backend.sh
Executable file
42
ci/build-backend.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
# Package the backend Python source for distribution.
|
||||
#
|
||||
# Environment variables:
|
||||
# OUTPUT_DIR - where to write the tarball (default: ./dist)
|
||||
# VERSION - version string (default: read from VERSION file)
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
WORKSPACE="${SCRIPT_DIR}/.."
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-${WORKSPACE}/dist}"
|
||||
VERSION="${VERSION:-$(cat "${WORKSPACE}/VERSION" 2>/dev/null || echo "0.1.0")}"
|
||||
|
||||
echo "=== Dangerous Pi Backend Package ==="
|
||||
echo "Version: ${VERSION}"
|
||||
|
||||
STAGING="/tmp/backend-staging/backend"
|
||||
rm -rf /tmp/backend-staging
|
||||
mkdir -p "$STAGING"
|
||||
|
||||
# Copy backend source
|
||||
cp -r "${WORKSPACE}/app/backend" "${STAGING}/app/backend"
|
||||
|
||||
# Copy requirements
|
||||
cp "${WORKSPACE}/requirements.txt" "${STAGING}/"
|
||||
|
||||
cat > "${STAGING}/COMPONENT_VERSION" << EOF
|
||||
{
|
||||
"component_id": "backend",
|
||||
"version": "${VERSION}",
|
||||
"build_date": "$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
||||
}
|
||||
EOF
|
||||
|
||||
mkdir -p "$OUTPUT_DIR"
|
||||
TARBALL="backend-${VERSION}.tar.gz"
|
||||
cd /tmp/backend-staging
|
||||
tar -czf "${OUTPUT_DIR}/${TARBALL}" backend/
|
||||
echo "✅ Built: ${OUTPUT_DIR}/${TARBALL}"
|
||||
|
||||
rm -rf /tmp/backend-staging
|
||||
Reference in New Issue
Block a user