feat(build): publier les images API+web sur le registry Gitea et faire consommer compose aux packages — compose tire ${READABOOK_REGISTRY}/api|web au lieu de builder, scripts/publish.sh (buildx --push, labels OCI), override docker-compose.build.yaml pour le build local, chemin bibliothèque re-paramétrable via READABOOK_LIBRARY_HOST_PATH — évolution #50
This commit is contained in:
41
scripts/publish.sh
Executable file
41
scripts/publish.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REGISTRY="${READABOOK_REGISTRY:-gitea.anthonybouteiller.ovh/blomios/readabook}"
|
||||
TAG="${READABOOK_TAG:-latest}"
|
||||
REVISION="${OCI_IMAGE_REVISION:-$(git rev-parse HEAD)}"
|
||||
CREATED="${OCI_IMAGE_CREATED:-$(date -u +%Y-%m-%dT%H:%M:%SZ)}"
|
||||
PLATFORM="${DOCKER_BUILD_PLATFORM:-}"
|
||||
|
||||
build_args=(
|
||||
--build-arg "OCI_IMAGE_CREATED=${CREATED}"
|
||||
--build-arg "OCI_IMAGE_REVISION=${REVISION}"
|
||||
--build-arg "OCI_IMAGE_VERSION=${TAG}"
|
||||
)
|
||||
|
||||
platform_args=()
|
||||
if [[ -n "${PLATFORM}" ]]; then
|
||||
platform_args=(--platform "${PLATFORM}")
|
||||
fi
|
||||
|
||||
echo "Publishing ReadaBook images to ${REGISTRY} with tag ${TAG}"
|
||||
|
||||
docker buildx build \
|
||||
"${platform_args[@]}" \
|
||||
"${build_args[@]}" \
|
||||
--tag "${REGISTRY}/api:${TAG}" \
|
||||
--push \
|
||||
--file Dockerfile \
|
||||
.
|
||||
|
||||
docker buildx build \
|
||||
"${platform_args[@]}" \
|
||||
"${build_args[@]}" \
|
||||
--tag "${REGISTRY}/web:${TAG}" \
|
||||
--push \
|
||||
--file apps/web/Dockerfile \
|
||||
.
|
||||
|
||||
echo "Published:"
|
||||
echo " ${REGISTRY}/api:${TAG}"
|
||||
echo " ${REGISTRY}/web:${TAG}"
|
||||
Reference in New Issue
Block a user