Files
microblog.pub/update-microblogpub.sh
2025-07-20 22:28:20 +00:00

26 lines
594 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 -euo pipefail
IMAGE="microblogpub:latest"
TAR="microblogpub.tar"
NAMESPACE="microblogpub"
APP_LABEL="app=microblogpub"
echo " Пересборка образа…"
docker build -t "${IMAGE}" .
echo " Экспорт в ${TAR}"
docker save "${IMAGE}" -o "${TAR}"
echo " Импорт в k3s containerd…"
sudo k3s ctr images import "${TAR}"
echo " Очистка tar-файла…"
rm -f "${TAR}"
echo " Перезапуск Pods…"
kubectl -n "${NAMESPACE}" rollout restart deployment/microblogpub
echo "✅ Готово!"