feat: support stopping only the web container in run-stage.sh and update GEMINI.md rules
This commit is contained in:
@@ -5,11 +5,15 @@
|
||||
set -e
|
||||
|
||||
NEXUS_ONLY=false
|
||||
STOP=false
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--nexus-only|-n)
|
||||
NEXUS_ONLY=true
|
||||
;;
|
||||
--stop|-s)
|
||||
STOP=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -17,6 +21,24 @@ ENV_FILE=".env.stage"
|
||||
TEMPLATE_FILE=".env.stage.template"
|
||||
COMPOSE_FILE="docker-compose.stage.yml"
|
||||
|
||||
if [ "$STOP" = true ]; then
|
||||
echo "🛑 Stopping staging environment..."
|
||||
if [ ! -f "$ENV_FILE" ] && [ -f "$TEMPLATE_FILE" ]; then
|
||||
cp "$TEMPLATE_FILE" "$ENV_FILE"
|
||||
fi
|
||||
if [ "$NEXUS_ONLY" = true ]; then
|
||||
echo "🧹 Stopping and removing only the web (nexus) container..."
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" stop web || true
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" rm -f web || true
|
||||
else
|
||||
echo "🧹 Stopping all containers..."
|
||||
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" down --remove-orphans || true
|
||||
docker compose down --remove-orphans 2>/dev/null || true
|
||||
fi
|
||||
echo "✅ Staging environment stopped."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "🏁 Starting staging environment orchestration..."
|
||||
if [ "$NEXUS_ONLY" = true ]; then
|
||||
echo "ℹ️ Mode: --nexus-only (only the web/nexus application container will be modified)"
|
||||
|
||||
Reference in New Issue
Block a user