30 lines
976 B
Bash
Executable file
30 lines
976 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
ZMK_DOCKER_IMAGE="${ZMK_DOCKER_IMAGE:-docker.io/zmkfirmware/zmk-build-arm:stable}"
|
|
|
|
if [[ -n $ZMK_PULL_DOCKER_IMAGE ]]; then
|
|
docker pull "$ZMK_DOCKER_IMAGE"
|
|
fi
|
|
|
|
mkdir -p "${PWD}/build"
|
|
mkdir -p "${PWD}/.cache"
|
|
podman run -it --rm \
|
|
-v "${PWD}/.cache:/zofle" \
|
|
-v "${PWD}/config:/zofle/config:ro" \
|
|
-v "${PWD}/build:/build" \
|
|
"$ZMK_DOCKER_IMAGE" sh -c '
|
|
set -x
|
|
set -e
|
|
cd /zofle
|
|
git config --global --add safe.directory /zofle/zmk
|
|
west init -l config || true # allowed to fail since it will fail if already initialized
|
|
west update
|
|
west zephyr-export
|
|
echo "Building left"
|
|
west build --pristine -s zmk/app -b nice_nano_v2 -- -DSHIELD=sofle_left -DZMK_CONFIG="/zofle/config"
|
|
cp /zofle/build/zephyr/zmk.uf2 /build/sofle_left_nice_nano.uf2
|
|
echo "Building right"
|
|
west build --pristine -s zmk/app -b nice_nano_v2 -- -DSHIELD=sofle_right -DZMK_CONFIG="/zofle/config"
|
|
cp /zofle/build/zephyr/zmk.uf2 /build/sofle_right_nice_nano.uf2
|
|
'
|