50 lines
2.2 KiB
Bash
Executable File
50 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Local iteration loop: build both custom images for this machine's own
|
|
# architecture (fast, no registry push — see erpnext-image/build.sh and
|
|
# backend/build.sh's own local-vs-registry branching) and bring the
|
|
# affected services up immediately so you can test against them. Run this
|
|
# as often as you want while developing; nothing here touches git or the
|
|
# registry — see scripts/prod.sh for shipping what you've tested here.
|
|
#
|
|
# What happens when this runs, in order:
|
|
# 1. ./generate-dokploy-compose.sh — keeps docker-compose.dokploy.yml's
|
|
# marketing content-hash in sync as you edit bettersightbox-index.html,
|
|
# so there's nothing new for prod.sh to auto-commit at ship time. Not
|
|
# committed here — dev.sh never touches git; prod.sh is the only one
|
|
# that commits, gated behind its own clean-tree/test checks.
|
|
# 2. ./erpnext-image/build.sh — CUSTOM_IMAGE in the root .env is a bare
|
|
# local tag (not a registry path), so this takes the local branch:
|
|
# builds sightbox-erpnext for this machine's own architecture, no push.
|
|
# 3. ./backend/build.sh — same thing for BACKEND_BILLING_IMAGE: builds
|
|
# sightbox-backend-billing locally, no push.
|
|
# 4. docker compose up -d --force-recreate on every service that runs
|
|
# from either image — the seven ERPNext-image services (configurator,
|
|
# backend, frontend, websocket, queue-short, queue-long, scheduler)
|
|
# plus backend-billing — so the freshly-built images actually get
|
|
# picked up. (Compose has no "recreate everyone using image X" — it
|
|
# only accepts service names, so all eight get listed individually
|
|
# even though only one or two images actually changed.)
|
|
#
|
|
# Usage (from the sightbox/ project root or from here — either works):
|
|
# ./scripts/dev.sh
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
ROOT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
cd "$ROOT_DIR"
|
|
|
|
./generate-dokploy-compose.sh
|
|
|
|
./erpnext-image/build.sh
|
|
./backend/build.sh
|
|
|
|
echo
|
|
echo "Bringing up the affected services locally..."
|
|
docker compose up -d --force-recreate \
|
|
configurator backend frontend websocket queue-short queue-long scheduler \
|
|
backend-billing
|
|
|
|
echo
|
|
echo "Done — test against your local stack now."
|