Files
opencode-manager/scripts/docker-upgrade.sh
Chris Scott 11eddb1de3 Security: Update dependencies for CVE fixes and infrastructure improvements (#102)
* Update dependencies for CVE security fixes

- Update hono from ^4.10.1 to ^4.11.7
- Update react-router-dom from ^7.9.4 to ^7.13.0

All tests passing, no breaking changes detected

* Refactor SSE to use Hono's built-in streamSSE

* Revert SSE implementation and update Docker upgrade script
2026-02-01 10:58:39 -05:00

54 lines
996 B
Bash
Executable File

#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
if command -v docker compose &> /dev/null; then
DOCKER_COMPOSE="docker compose"
else
DOCKER_COMPOSE="docker-compose"
fi
NO_PULL=false
SHOW_LOGS=false
while [[ $# -gt 0 ]]; do
case $1 in
--no-pull)
NO_PULL=true
shift
;;
--logs)
SHOW_LOGS=true
shift
;;
*)
echo "Usage: $0 [--no-pull] [--logs]"
exit 1
;;
esac
done
if [ "$NO_PULL" = false ]; then
echo -e "${YELLOW}Updating repository...${NC}"
git pull || exit 1
fi
echo -e "${YELLOW}Stopping container...${NC}"
$DOCKER_COMPOSE down
echo -e "${YELLOW}Rebuilding image with no cache...${NC}"
$DOCKER_COMPOSE build --no-cache
echo -e "${YELLOW}Starting container...${NC}"
$DOCKER_COMPOSE up -d
if [ "$SHOW_LOGS" = true ]; then
echo -e "${GREEN}Container started. Showing logs...${NC}"
$DOCKER_COMPOSE logs -f
else
echo -e "${GREEN}Upgrade complete${NC}"
$DOCKER_COMPOSE ps
fi