#!/usr/bin/env bash # Requires qemu-user-static # docker run --privileged --rm tonistiigi/binfmt --install arm64 # docker buildx create --use --name multi-arch-builder REPO_URL="https://gitea.sesh.jetzt/yen/cph_open" echo "version: ${HIIVE_API_VERSION}" mkdir arm64 ssh root@yenting.party -t "if [ -d /opt/cph_open ]; then cd /opt/cph_open/; else cd /opt/ && git clone $REPO_URL && cd cph_open; fi; git fetch --all && git reset --hard origin/main && git switch main && cargo build --release --bin cph_open" scp root@yenting.party:/opt/cph_open/target/release/cph_open arm64/cph_open docker buildx build --platform linux/arm64 -t yen3k/cph_open --push --file Dockerfile-arm64 . rm -r arm64