27 lines
744 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -xeuo pipefail
VERSION=$(<VERSION)
IMAGE="dr.zoemp.be/slskd:${VERSION}"
LOCATION="slskd" # sous-domaine ⇒ slskd.ton-domaine.be
FQDN="${LOCATION}.${CLOUDRON_APP_DOMAIN:-zoemp.be}"
# 1) build + push
docker build --platform linux/amd64 -t "${IMAGE}" -f Dockerfile.cloudron .
docker push "${IMAGE}"
# 2) install ou update sur Cloudron
if cloudron status --app "${FQDN}" &>/dev/null; then
echo "🔄 Mise à jour de ${FQDN}${IMAGE}"
cloudron update \
--image "${IMAGE}" \
--app "${FQDN}"
else
echo "🚀 Installation de lapp sur ${FQDN}"
cloudron install \
--image "${IMAGE}" \
--location "${LOCATION}" \
"${CLOUDRON_MANIFEST_ID:-slskd.zoemp.be}"
fi