cyberhybridhub/scripts/deploy-production.sh
2026-06-04 19:31:04 +00:00

37 lines
954 B
Bash
Executable File

#!/usr/bin/env bash
# Prepare a production deploy (no sudo). After this succeeds, install/restart systemd:
# ./hosting/install-systemd.sh
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
echo "==> Flutter web (release)"
"$ROOT/scripts/build-production-web.sh"
echo "==> API dependencies"
(
cd "$ROOT/server"
if ! command -v dart >/dev/null 2>&1; then
echo "dart not found on PATH" >&2
exit 1
fi
dart pub get
)
if [ ! -f "$ROOT/server/.env" ]; then
echo ""
echo "Warning: $ROOT/server/.env is missing."
echo " Create and configure it before starting cyberhybridhub-api."
if [ -f "$ROOT/server/.env.example" ]; then
echo " cp server/.env.example server/.env"
fi
fi
echo ""
echo "Deploy artifacts ready."
echo "Next (requires sudo):"
echo " cp hosting/hosting.env.example hosting/hosting.env # if not done"
echo " edit hosting/hosting.env"
echo " ./hosting/install-systemd.sh"