feat(manage): add update and cloud-update commands (closes #127)

Adds `update` (local stack) and `cloud-update` (menagerie) subcommands
to manage.sh. Both pull HEAD and rebuild/restart the Docker stack in one
step — required for post-merge deployment without manual compose commands.
This commit is contained in:
pyr0ball 2026-05-11 11:32:30 -07:00
parent e62d69d099
commit e83bb0415a

View file

@ -14,8 +14,8 @@ OVERRIDE_FLAG=""
[[ -f "compose.override.yml" ]] && OVERRIDE_FLAG="-f compose.override.yml" [[ -f "compose.override.yml" ]] && OVERRIDE_FLAG="-f compose.override.yml"
usage() { usage() {
echo "Usage: $0 {start|stop|restart|status|logs|open|build|test" echo "Usage: $0 {start|stop|restart|status|logs|open|build|test|update"
echo " |cloud-start|cloud-stop|cloud-restart|cloud-status|cloud-logs|cloud-build}" echo " |cloud-start|cloud-stop|cloud-restart|cloud-status|cloud-logs|cloud-build|cloud-update}"
echo "" echo ""
echo "Dev:" echo "Dev:"
echo " start Build (if needed) and start all services" echo " start Build (if needed) and start all services"
@ -26,6 +26,7 @@ usage() {
echo " open Open web UI in browser" echo " open Open web UI in browser"
echo " build Rebuild Docker images without cache" echo " build Rebuild Docker images without cache"
echo " test Run pytest test suite" echo " test Run pytest test suite"
echo " update git pull + rebuild + restart dev stack"
echo "" echo ""
echo "Cloud (menagerie.circuitforge.tech/kiwi):" echo "Cloud (menagerie.circuitforge.tech/kiwi):"
echo " cloud-start Build cloud images and start kiwi-cloud project" echo " cloud-start Build cloud images and start kiwi-cloud project"
@ -34,6 +35,7 @@ usage() {
echo " cloud-status Show cloud containers" echo " cloud-status Show cloud containers"
echo " cloud-logs Follow cloud logs [api|web — defaults to all]" echo " cloud-logs Follow cloud logs [api|web — defaults to all]"
echo " cloud-build Rebuild cloud images without cache" echo " cloud-build Rebuild cloud images without cache"
echo " cloud-update git pull + rebuild + restart cloud stack"
exit 1 exit 1
} }
@ -68,6 +70,11 @@ case "$cmd" in
build) build)
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG build --no-cache docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG build --no-cache
;; ;;
update)
git pull
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG up -d --build
echo "Kiwi updated and restarted → http://localhost:${WEB_PORT}"
;;
test) test)
docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG run --rm api \ docker compose -f "$COMPOSE_FILE" $OVERRIDE_FLAG run --rm api \
conda run -n job-seeker pytest tests/ -v conda run -n job-seeker pytest tests/ -v
@ -95,6 +102,11 @@ case "$cmd" in
cloud-build) cloud-build)
docker compose -f "$CLOUD_COMPOSE_FILE" -p "$CLOUD_PROJECT" build --no-cache docker compose -f "$CLOUD_COMPOSE_FILE" -p "$CLOUD_PROJECT" build --no-cache
;; ;;
cloud-update)
git pull
docker compose -f "$CLOUD_COMPOSE_FILE" -p "$CLOUD_PROJECT" up -d --build
echo "Kiwi cloud updated and restarted → https://menagerie.circuitforge.tech/kiwi"
;;
*) *)
usage usage