Files
finrod/build.sh
João Pedro Battistella Nadas f9acdef3fe chore: introduce semver + CHANGELOG.md, cut v0.1.0
- CHANGELOG.md following Keep a Changelog; 0.1.0 entry covers all
  features shipped through the loaded-model indicator
- build.sh now also tags the image with the version read from
  pyproject.toml, e.g. rg.nl-ams.scw.cloud/valinor/finrod:0.1.0
- README documents the release workflow (edit CHANGELOG, bump
  pyproject version, merge, tag vX.Y.Z, build, bump valinor)
2026-06-09 15:55:09 +02:00

42 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Manual multi-arch build + push fallback when Gitea Actions isn't available.
#
# One-time setup:
# docker buildx create --name multi --use
# docker run --privileged --rm tonistiigi/binfmt --install all
#
# Auth:
# docker login rg.nl-ams.scw.cloud -u nologin -p <SCW_SECRET_KEY>
#
# Usage:
# ./build.sh
#
# Always tags:
# :latest — moving pointer
# :<git-short-sha> — immutable, traceable to a commit
# :<pyproject-version> — semver from pyproject.toml (e.g. :0.1.0)
set -euo pipefail
cd "$(dirname "$0")"
REGISTRY="${REGISTRY:-rg.nl-ams.scw.cloud/valinor}"
IMAGE="${REGISTRY}/finrod"
SHA="$(git rev-parse --short HEAD)"
VERSION="$(awk -F\" '/^version =/ {print $2; exit}' pyproject.toml)"
: "${VERSION:?Could not read version from pyproject.toml}"
TAGS=(-t "${IMAGE}:latest" -t "${IMAGE}:${SHA}" -t "${IMAGE}:${VERSION}")
docker buildx build \
--platform linux/amd64,linux/arm64 \
"${TAGS[@]}" \
--push \
.
echo
echo "Pushed:"
echo " ${IMAGE}:latest"
echo " ${IMAGE}:${SHA}"
echo " ${IMAGE}:${VERSION}"