chore: standardize cloud commands to hyphen syntax + add update command

Closes #1: rename cloud:* subcommands to cloud-* (hyphen is the
conventional CLI separator; colon syntax is non-standard).

Closes #2: add update (git pull + rebuild) for both local and cloud
stacks, covering the common deploy-from-git workflow.
This commit is contained in:
pyr0ball 2026-05-13 16:12:12 -07:00
parent 3765fbc0f9
commit df9e91ad89

View file

@ -12,8 +12,8 @@ OVERRIDE_ARGS=()
[[ -f "compose.override.yml" ]] && OVERRIDE_ARGS=(-f compose.override.yml) [[ -f "compose.override.yml" ]] && OVERRIDE_ARGS=(-f compose.override.yml)
usage() { usage() {
echo "Usage: $0 {start|stop|restart|status|logs [svc]|open|build|test" echo "Usage: $0 {start|stop|restart|status|logs [svc]|open|build|test|update"
echo " |cloud:start|cloud:stop|cloud:restart|cloud:status|cloud:logs [svc]|cloud:build}" echo " |cloud-start|cloud-stop|cloud-restart|cloud-status|cloud-logs [svc]|cloud-build|cloud-update}"
exit 1 exit 1
} }
@ -48,27 +48,39 @@ case "$cmd" in
test) test)
conda run -n cf pytest tests/ -v conda run -n cf pytest tests/ -v
;; ;;
cloud:start) update)
git pull
docker compose -f "$COMPOSE_FILE" "${OVERRIDE_ARGS[@]}" down
docker compose -f "$COMPOSE_FILE" "${OVERRIDE_ARGS[@]}" up -d --build
echo "Pagepiper updated and running → http://localhost:${WEB_PORT}"
;;
cloud-start)
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" up -d --build docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" up -d --build
echo "Pagepiper cloud running → http://localhost:${CLOUD_WEB_PORT}" echo "Pagepiper cloud running → http://localhost:${CLOUD_WEB_PORT}"
;; ;;
cloud:stop) cloud-stop)
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" down docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" down
;; ;;
cloud:restart) cloud-restart)
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" down docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" down
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" up -d --build docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" up -d --build
echo "Pagepiper cloud running → http://localhost:${CLOUD_WEB_PORT}" echo "Pagepiper cloud running → http://localhost:${CLOUD_WEB_PORT}"
;; ;;
cloud:status) cloud-status)
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" ps docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" ps
;; ;;
cloud:logs) cloud-logs)
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" logs -f "${1:-}" docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" logs -f "${1:-}"
;; ;;
cloud:build) cloud-build)
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" build --no-cache docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" build --no-cache
;; ;;
cloud-update)
git pull
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" down
docker compose -f "$COMPOSE_CLOUD_FILE" -p "$CLOUD_PROJECT" up -d --build
echo "Pagepiper cloud updated and running → http://localhost:${CLOUD_WEB_PORT}"
;;
*) *)
usage usage
;; ;;