dropshell-build/publish.sh
Your Name fd1d4b290e
All checks were successful
dropshell-build / build (push) Successful in 11s
Remove manual login
2025-06-12 22:10:57 +12:00

46 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
# login to registry handled by gitea workflow, otherwise asssume handled manually.
#docker login -u "anything" -p "${DOCKER_PUSH_TOKEN}" gitea.jde.nz
# Build and push the multi-platform image
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"