dropshell-build/publish.sh
j842 e366e53529
Some checks failed
dropshell-build / build (push) Failing after 6m20s
Convert to multi-arch docker image.
2025-06-10 17:26:06 +12:00

44 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
die() {
echo "Fatal error:"
echo "$1"
exit 1
}
# check the variables are present
[[ -n $SOS_WRITE_TOKEN ]] || die "SOS_WRITE_TOKEN not specified"
[[ -n $DOCKER_PUSH_TOKEN ]] || die "DOCKER_PUSH_TOKEN not specified"
# Publish gitea.jde.nz/public/dropshell-build-base:latest
docker login -u "anything" -p "${DOCKER_PUSH_TOKEN}" gitea.jde.nz
# Push the multi-platform image that was built by build-base/build.sh
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t "gitea.jde.nz/public/dropshell-build-base:latest" \
-f "build-base/Dockerfile.dropshell-build-base" \
--push \
build-base/
#SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
# # download the sos binary
# SOS="${SCRIPT_DIR}/temp/sos"
# mkdir -p "${SCRIPT_DIR}/temp"
# trap 'rm -rf "${SCRIPT_DIR}/temp"' EXIT
# curl -L -o "${SOS}" https://getbin.xyz/sos
# chmod +x "${SOS}"
# # upload the dropshell-build script
# "${SOS}" upload "getbin.xyz" "${SCRIPT_DIR}/Dockerfile.dropshell-build" "Dockerfile.dropshell-build:latest"
echo "Done"