chore(deploy): add deploy.sh remote script, update Makefile
- deploy.sh: SSH-triggered deploy for prod and test environments on srv-nyx (linode.oneskyit.com). Pulls repos, builds ae_app container with correct BUILD_MODE, restarts ae_api. - Makefile: rename build-ui → build-docker-dev/test/prod to match new naming convention; add deploy-remote-test and deploy-remote-prod targets - .env.default: AE_APP_BUILD_MODE staging → dev (from prior session) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -134,7 +134,7 @@ AE_SMTP_PASSWORD=XXXX
|
|||||||
# APP SETTINGS (SvelteKit)
|
# APP SETTINGS (SvelteKit)
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
AE_APP_ENV=development
|
AE_APP_ENV=development
|
||||||
AE_APP_BUILD_MODE=staging
|
AE_APP_BUILD_MODE=dev
|
||||||
AE_APP_REPLICAS=2
|
AE_APP_REPLICAS=2
|
||||||
# AE App (Node SvelteKit) Gateway Port for External Reverse Proxy
|
# AE App (Node SvelteKit) Gateway Port for External Reverse Proxy
|
||||||
AE_APP_GATEWAY_PORT=3001
|
AE_APP_GATEWAY_PORT=3001
|
||||||
|
|||||||
22
Makefile
22
Makefile
@@ -1,7 +1,7 @@
|
|||||||
# Aether Platform - Operations Makefile
|
# Aether Platform - Operations Makefile
|
||||||
# Use these shortcuts for faster development and deployment.
|
# Use these shortcuts for faster development and deployment.
|
||||||
|
|
||||||
.PHONY: up down restart-api build-api build-ui logs ps
|
.PHONY: up down restart-api build-api build-docker-dev build-docker-test build-docker-prod logs ps deploy-remote-test deploy-remote-prod
|
||||||
|
|
||||||
# Start the entire stack
|
# Start the entire stack
|
||||||
up:
|
up:
|
||||||
@@ -21,10 +21,18 @@ restart-api:
|
|||||||
build-api:
|
build-api:
|
||||||
docker compose up -d --build ae_api
|
docker compose up -d --build ae_api
|
||||||
|
|
||||||
# REBUILD UI: Standard autonomous build for SvelteKit
|
# BUILD DOCKER UI: Build the SvelteKit container for the given mode.
|
||||||
build-ui:
|
# Use 'npm run dev' for active development (Vite HMR, no Docker).
|
||||||
|
# Use these only when testing the production-like Docker build locally.
|
||||||
|
build-docker-dev:
|
||||||
docker compose build ae_app && docker compose up -d ae_app
|
docker compose build ae_app && docker compose up -d ae_app
|
||||||
|
|
||||||
|
build-docker-test:
|
||||||
|
docker compose build --build-arg BUILD_MODE=test ae_app && docker compose up -d ae_app
|
||||||
|
|
||||||
|
build-docker-prod:
|
||||||
|
docker compose build --build-arg BUILD_MODE=prod ae_app && docker compose up -d --remove-orphans ae_app
|
||||||
|
|
||||||
# View combined logs
|
# View combined logs
|
||||||
logs:
|
logs:
|
||||||
docker compose logs -f --tail=100
|
docker compose logs -f --tail=100
|
||||||
@@ -32,3 +40,11 @@ logs:
|
|||||||
# Check service status
|
# Check service status
|
||||||
ps:
|
ps:
|
||||||
docker compose ps
|
docker compose ps
|
||||||
|
|
||||||
|
# Remote deploy (SSH to linode.oneskyit.com, run deploy.sh)
|
||||||
|
# Requires key-based SSH and deploy.sh committed + pulled on the server.
|
||||||
|
deploy-remote-test:
|
||||||
|
ssh linode.oneskyit.com 'bash /srv/env/test_aether/deploy.sh test'
|
||||||
|
|
||||||
|
deploy-remote-prod:
|
||||||
|
ssh linode.oneskyit.com 'bash /srv/env/prod_aether/deploy.sh prod'
|
||||||
|
|||||||
88
deploy.sh
Executable file
88
deploy.sh
Executable file
@@ -0,0 +1,88 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# deploy.sh — Remote deploy for Aether Platform
|
||||||
|
# Run on srv-nyx directly, or triggered via SSH from the workstation.
|
||||||
|
#
|
||||||
|
# Usage: ./deploy.sh <prod|test> [app_branch] [api_branch]
|
||||||
|
# Example: ./deploy.sh prod
|
||||||
|
# ./deploy.sh test ae_app_3x_llm development
|
||||||
|
#
|
||||||
|
# From workstation (npm run deploy:remote:prod / deploy:remote:test):
|
||||||
|
# ssh linode.oneskyit.com 'bash /srv/env/prod_aether/deploy.sh prod'
|
||||||
|
# ssh linode.oneskyit.com 'bash /srv/env/test_aether/deploy.sh test'
|
||||||
|
#
|
||||||
|
# NOTE: bak_aether shares the same app/api dirs as prod.
|
||||||
|
# After a prod deploy, restart bak containers manually if running:
|
||||||
|
# cd /srv/env/bak_aether && docker compose restart ae_app ae_api
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ENV=${1:-}
|
||||||
|
if [ -z "$ENV" ]; then
|
||||||
|
echo "Usage: $0 <prod|test> [app_branch] [api_branch]"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- Environment config ---
|
||||||
|
# TODO: Update default branches once prod/test branch strategy is finalized.
|
||||||
|
# Currently both envs pull from the same working branches.
|
||||||
|
if [ "$ENV" = "prod" ]; then
|
||||||
|
APP_DIR=/srv/apps/prod_aether_app_sveltekit
|
||||||
|
API_DIR=/srv/apps/prod_aether_api_fastapi
|
||||||
|
COMPOSE_DIR=/srv/env/prod_aether
|
||||||
|
BUILD_MODE=prod
|
||||||
|
APP_BRANCH=${2:-ae_app_3x_llm}
|
||||||
|
API_BRANCH=${3:-development}
|
||||||
|
elif [ "$ENV" = "test" ]; then
|
||||||
|
APP_DIR=/srv/apps/test_aether_app_sveltekit
|
||||||
|
API_DIR=/srv/apps/test_aether_api_fastapi
|
||||||
|
COMPOSE_DIR=/srv/env/test_aether
|
||||||
|
BUILD_MODE=test
|
||||||
|
APP_BRANCH=${2:-ae_app_3x_llm}
|
||||||
|
API_BRANCH=${3:-development}
|
||||||
|
else
|
||||||
|
echo "Unknown environment: '$ENV' (expected: prod or test)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "========================================"
|
||||||
|
echo " Aether Deploy: $ENV"
|
||||||
|
echo " App: $APP_DIR [$APP_BRANCH]"
|
||||||
|
echo " API: $API_DIR [$API_BRANCH]"
|
||||||
|
echo " Mode: $BUILD_MODE"
|
||||||
|
echo "========================================"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# --- Pull repos ---
|
||||||
|
echo "[1/4] Pulling container env..."
|
||||||
|
git -C "$COMPOSE_DIR" pull --ff-only
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "[2/4] Pulling app ($APP_BRANCH)..."
|
||||||
|
git -C "$APP_DIR" pull --ff-only origin "$APP_BRANCH"
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "[3/4] Pulling API ($API_BRANCH)..."
|
||||||
|
git -C "$API_DIR" pull --ff-only origin "$API_BRANCH"
|
||||||
|
|
||||||
|
# --- Build and deploy ---
|
||||||
|
echo ""
|
||||||
|
echo "[4/4] Building and deploying..."
|
||||||
|
cd "$COMPOSE_DIR"
|
||||||
|
docker compose build --build-arg BUILD_MODE="$BUILD_MODE" ae_app
|
||||||
|
docker compose up -d ae_app
|
||||||
|
docker compose restart ae_api
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "========================================"
|
||||||
|
echo " Done: $ENV deployed successfully"
|
||||||
|
echo "========================================"
|
||||||
|
|
||||||
|
if [ "$ENV" = "prod" ]; then
|
||||||
|
echo ""
|
||||||
|
echo " bak_aether uses the same code dirs — if its containers"
|
||||||
|
echo " are running, restart them:"
|
||||||
|
echo " cd /srv/env/bak_aether && docker compose restart ae_app ae_api"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
Reference in New Issue
Block a user