diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-18 10:24:32 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-18 10:24:32 +0200 |
| commit | 7a0771215d9bd52dc9d6913abee56a9f62893d3e (patch) | |
| tree | 4e81472da16b953307f6a416067cf9e3c7c1d223 /scripts | |
| parent | 041b2dd29d30a8ecadca22ef25282cbad672d94e (diff) | |
| download | bokf-8446f0070d451179b92f09d2b5548b481bc3105d.tar.gz bokf-8446f0070d451179b92f09d2b5548b481bc3105d.zip | |
deploy: cross-compile arm64 binaries on the dev machinev0.1.13
The target only assembles the image from prebuilt binaries, so redeploys
no longer compile sqlite/argon2 on the NAS. New deploy/Dockerfile.cross
provides the gcc-aarch64-linux-gnu toolchain; the Dockerfile uses
.prebuilt/ when present.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/deploy.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 25c86dc..c345a21 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -47,7 +47,7 @@ case "$BOKF_BUILD" in if [ "$(uname -m)" = "$host_arch" ]; then BOKF_BUILD=local else - echo "deploy: host is $host_arch, building there" + echo "deploy: host is $host_arch, cross-building here" BOKF_BUILD=remote fi ;; @@ -64,12 +64,25 @@ if [ "$BOKF_BUILD" = local ]; then echo "deploy: shipping image to $BOKF_HOST" docker save "bokf:$TAG" | gzip | "${SSH[@]}" 'gunzip | docker load' else - echo "deploy: building image bokf:$TAG on $BOKF_HOST" + echo "deploy: cross-compiling $host_arch binaries on this machine" + rm -rf .prebuilt + mkdir -p .prebuilt + docker build -q -f deploy/Dockerfile.cross -t bokf-cross deploy/ >/dev/null + docker run --rm -e "VERSION=$TAG" -v "$PWD":/src:ro \ + -v "$PWD/.prebuilt":/out bokf-cross + if command -v file >/dev/null 2>&1 && + ! file .prebuilt/bokfd | grep -q aarch64; then + echo "deploy: cross-build produced no arm64 binary" >&2 + rm -rf .prebuilt + exit 1 + fi + echo "deploy: assembling image bokf:$TAG on $BOKF_HOST" tar -cf - \ --exclude=./.git --exclude=./build --exclude=./var --exclude=./.env \ --exclude='./*.se' --exclude='./*.db' --exclude='./*.db-wal' \ --exclude='./*.db-shm' --exclude=./docs . | "${SSH[@]}" "docker build --build-arg 'VERSION=$TAG' -t 'bokf:$TAG' -" + rm -rf .prebuilt fi remote "mkdir -p '$BOKF_REMOTE_DIR'" |
