Consolidate and fix image rebuild scripts
This commit is contained in:
16
build-image.sh
Executable file
16
build-image.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
DOCKERFILE="Dockerfile.$1.$2"
|
||||
|
||||
EXTRA_ARGS="--pull"
|
||||
if [ "$1" == "aarch64" ] || [ "$1" == "rpi64" ] || [ "$1" == "l4t" ]; then
|
||||
EXTRA_ARGS="$EXTRA_ARGS --platform linux/arm64"
|
||||
elif [ "$1" == "armhf" ] || [ "$1" == "rpi" ]; then
|
||||
EXTRA_ARGS="$EXTRA_ARGS --platform linux/arm/v7"
|
||||
elif [ "$1" == "riscv64" ]; then
|
||||
EXTRA_ARGS="$EXTRA_ARGS --platform linux/riscv64"
|
||||
fi
|
||||
|
||||
docker buildx build $EXTRA_ARGS -f $DOCKERFILE -t cgutman/moonlight-packaging:"$1-$2_$3" .
|
||||
@@ -1,16 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
TARGET_NAME="$1-$2"
|
||||
DOCKERFILE="Dockerfile.$1.$2"
|
||||
|
||||
EXTRA_ARGS="--pull"
|
||||
if [ "$1" == "aarch64" ] || [ "$1" == "rpi64" ] || [ "$1" == "l4t" ]; then
|
||||
EXTRA_ARGS="$EXTRA_ARGS --platform linux/arm64"
|
||||
elif [ "$1" == "armhf" ] || [ "$1" == "rpi" ]; then
|
||||
EXTRA_ARGS="$EXTRA_ARGS --platform linux/arm/v7"
|
||||
elif [ "$1" == "riscv64" ]; then
|
||||
EXTRA_ARGS="$EXTRA_ARGS --platform linux/riscv64"
|
||||
fi
|
||||
|
||||
TAG_UNIQUE_ID=`(git ls-tree HEAD; git diff-index HEAD) | sha256sum | cut -c-16`
|
||||
TAG_NAME="${TARGET_NAME}_${TAG_UNIQUE_ID}"
|
||||
@@ -28,7 +18,7 @@ if [ $PULL_EXIT_CODE -eq 0 ]; then
|
||||
echo Using pre-built Docker image - cgutman/moonlight-packaging:$TAG_NAME
|
||||
else
|
||||
echo Pre-built image not available - building cgutman/moonlight-packaging:$TAG_NAME
|
||||
docker buildx build $EXTRA_ARGS -f $DOCKERFILE -t cgutman/moonlight-packaging:$TAG_NAME .
|
||||
./build-image.sh $1 $2 $TAG_UNIQUE_ID
|
||||
echo Built Docker image - cgutman/moonlight-packaging:$TAG_NAME
|
||||
fi
|
||||
|
||||
|
||||
@@ -10,23 +10,23 @@ set -e
|
||||
|
||||
TAG_UNIQUE_ID=`git ls-tree HEAD | sha256sum | cut -c-16`
|
||||
|
||||
docker build --pull -f Dockerfile.rpi.bookworm -t cgutman/moonlight-packaging:rpi-bookworm_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.rpi64.bookworm -t cgutman/moonlight-packaging:rpi64-bookworm_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.rpi.trixie -t cgutman/moonlight-packaging:rpi-trixie_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.rpi64.trixie -t cgutman/moonlight-packaging:rpi64-trixie_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.riscv64.trixie -t cgutman/moonlight-packaging:riscv64-trixie_$TAG_UNIQUE_ID . &
|
||||
./build-image.sh l4t noble $TAG_UNIQUE_ID &
|
||||
./build-image.sh rpi trixie $TAG_UNIQUE_ID &
|
||||
./build-image.sh rpi64 trixie $TAG_UNIQUE_ID &
|
||||
./build-image.sh aarch64 jammy $TAG_UNIQUE_ID &
|
||||
./build-image.sh riscv64 trixie $TAG_UNIQUE_ID &
|
||||
wait
|
||||
docker build --pull -f Dockerfile.l4t.noble -t cgutman/moonlight-packaging:l4t-noble_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.aarch64.jammy -t cgutman/moonlight-packaging:aarch64-jammy_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.aarch64.noble -t cgutman/moonlight-packaging:aarch64-noble_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.armhf.jammy -t cgutman/moonlight-packaging:armhf-jammy_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.armhf.noble -t cgutman/moonlight-packaging:armhf-noble_$TAG_UNIQUE_ID . &
|
||||
./build-image.sh armhf jammy $TAG_UNIQUE_ID &
|
||||
./build-image.sh armhf trixie $TAG_UNIQUE_ID &
|
||||
./build-image.sh aarch64 trixie $TAG_UNIQUE_ID &
|
||||
./build-image.sh armhf noble $TAG_UNIQUE_ID &
|
||||
./build-image.sh aarch64 noble $TAG_UNIQUE_ID &
|
||||
wait
|
||||
docker build --pull -f Dockerfile.aarch64.bookworm -t cgutman/moonlight-packaging:aarch64-bookworm_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.aarch64.trixie -t cgutman/moonlight-packaging:aarch64-trixie_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.armhf.bookworm -t cgutman/moonlight-packaging:armhf-bookworm_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.armhf.trixie -t cgutman/moonlight-packaging:armhf-trixie_$TAG_UNIQUE_ID . &
|
||||
docker build --pull -f Dockerfile.l4t.jammy -t cgutman/moonlight-packaging:l4t-jammy_$TAG_UNIQUE_ID . &
|
||||
./build-image.sh rpi bookworm $TAG_UNIQUE_ID &
|
||||
./build-image.sh rpi64 bookworm $TAG_UNIQUE_ID &
|
||||
./build-image.sh armhf bookworm $TAG_UNIQUE_ID &
|
||||
./build-image.sh aarch64 bookworm $TAG_UNIQUE_ID &
|
||||
./build-image.sh l4t jammy $TAG_UNIQUE_ID &
|
||||
wait
|
||||
|
||||
docker push cgutman/moonlight-packaging:rpi-bookworm_$TAG_UNIQUE_ID
|
||||
|
||||
Reference in New Issue
Block a user