Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
137729a
fix: handle influx init-exit-restart so docker compose up does not abort
yh-noh Jun 30, 2026
0f4f991
fix: mcc infra run silently swallows docker compose failures
Jul 6, 2026
15327e8
Bump cb-spider to 0.12.34 and cb-tumblebug to 0.12.24
Jul 7, 2026
99e31f4
Merge pull request #61 from MZC-CSC/chore/bump-cb-spider-cb-tumblebug
dogfootman Jul 7, 2026
96c437b
Merge remote-tracking branch 'origin/develop' into develop
yh-noh Jul 7, 2026
09b6723
[feat]: align admin-cli IAM setup with permission.yaml seed
yh-noh Jul 15, 2026
0ba8abd
Merge pull request #62 from MZC-CSC/feat-admin-iam-permission-yaml
MZC-CSC Jul 15, 2026
737cb71
[refactor]: point MENU_PERMISSIONS env to permission.yaml
yh-noh Jul 15, 2026
932f092
Merge pull request #63 from MZC-CSC/fix-admin-menu-permissions-env-unify
MZC-CSC Jul 15, 2026
9244d67
chore: rename mci/pmk workload menu id and label
Jul 24, 2026
880a232
Merge pull request #64 from MZC-CSC/chore/menu-mci-pmk-rename
MZC-CSC Jul 24, 2026
cbefa40
Merge pull request #58 from MZC-CSC/worktree-fix-influxdb-hyphen-db-init
MZC-CSC Jul 24, 2026
509459a
Merge branch 'm-cmp:main' into develop
MZC-CSC Jul 24, 2026
bd5e37b
fix(nginx): allow ECDSA cipher suites for TLS 1.2 in nginx.template.conf
Aug 4, 2026
b503c4e
Merge pull request #65 from MZC-CSC/fix-alibaba-nginx-cipher
MZC-CSC Aug 4, 2026
3a6537c
Merge pull request #60 from MZC-CSC/fix/mcc-infra-run-exit-code
MZC-CSC Aug 4, 2026
0648115
[fix]: redirect plain-HTTP requests on SSL-only nginx ports to HTTPS
Aug 10, 2026
4b0aa7d
fix(setup): PREDEFINED_ROLE를 MC_IAM_MANAGER_PREDEFINED_ROLE로 통일
yh-noh Aug 10, 2026
bb0dcca
fix(registry): api.yaml에 listUserProjectsByWorkspace 액션 추가
yh-noh Aug 10, 2026
da53694
Merge pull request #66 from MZC-CSC/fix-nginx-497-redirect
MZC-CSC Aug 10, 2026
6832cb6
Merge pull request #67 from MZC-CSC/fix-predefinedrole-env-and-api-re…
MZC-CSC Aug 10, 2026
dbc07f6
fix: debounce Created/Exited detection in installAll.sh background mo…
yh-noh Aug 10, 2026
62debdd
feat: add --keep-current-images option to cleanAll.sh
yh-noh Aug 10, 2026
fcea25e
Merge pull request #68 from MZC-CSC/fix-admincli-startup-monitor-race
MZC-CSC Aug 10, 2026
abb9aab
Merge pull request #69 from MZC-CSC/fix-cleanall-keep-current-images
MZC-CSC Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ cd mc-admin-cli/bin

> **When to run cleanAll.sh**: Always run a full clean before switching deployment modes (dev ↔ prod) or changing the domain. Re-running `installAll.sh` over an existing setup without cleaning first can leave stale certificates, nginx config, or DB state that conflicts with the new configuration.

If you only need to reset containers/volumes but want to avoid re-pulling every image on the next `installAll.sh` run (e.g. to stay under a Docker Hub pull quota), use `--keep-current-images`. This still deletes containers/volumes/networks as usual, keeps the image versions currently pinned in `conf/docker/docker-compose.yaml`, and only removes older versions of those same images:
```shell
./cleanAll.sh --keep-current-images
```

---

## Known Issues
Expand Down
100 changes: 88 additions & 12 deletions bin/cleanAll.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,95 @@
#!/bin/bash

COMPOSE_FILE="../conf/docker/docker-compose.yaml"
KEEP_CURRENT_IMAGES=false

for arg in "$@"; do
case "$arg" in
--keep-current-images)
KEEP_CURRENT_IMAGES=true
;;
-h|--help)
echo "Usage: $0 [--keep-current-images]"
echo " --keep-current-images Keep images pinned in $COMPOSE_FILE (only remove older"
echo " versions of the same repositories). Avoids re-pulling"
echo " on the next installAll.sh run and Docker Hub pull quota hits."
exit 0
;;
*)
echo "Unknown option: $arg (use -h for usage)"
exit 1
;;
esac
done

# Warning message and user confirmation
cat <<EOF
if [ "$KEEP_CURRENT_IMAGES" = true ]; then
cat <<EOF
[WARNING]
This shell script will delete containers, volumes, networks, and all container-volume
directories used for persistent data. Docker images pinned in $COMPOSE_FILE
will be KEPT (older versions of the same repositories are still removed) since
--keep-current-images was given.
Are you sure you want to continue? (y/n)
EOF
else
cat <<EOF
[WARNING]
This shell script will delete ALL Docker images, containers, volumes, networks, and also remove all container-volume directories used for persistent data.
This is intended to reset your environment to a clean state.
Are you sure you want to continue? (y/n)
EOF
fi
read -r answer
if [[ ! "$answer" =~ ^[Yy]$ ]]; then
echo "Aborted by user."
exit 1
fi

# Delete all Docker images
echo "All Docker images deleting..."
if [ -n "$(docker images -q)" ]; then
echo "docker rmi \$(docker images -q) -f"
docker rmi $(docker images -q) -f
# Delete Docker images
if [ "$KEEP_CURRENT_IMAGES" = true ]; then
echo "Selective image cleanup (--keep-current-images)..."
if [ -f "$COMPOSE_FILE" ]; then
mapfile -t current_images < <(grep -E '^[[:space:]]*image:[[:space:]]*\S+' "$COMPOSE_FILE" | sed -E 's/^[[:space:]]*image:[[:space:]]*//' | sort -u)

declare -A keep_exact=()
declare -A keep_repo=()
for img in "${current_images[@]}"; do
keep_exact["$img"]=1
keep_repo["${img%:*}"]=1
done

images_to_remove=()
while IFS= read -r local_img; do
[ -z "$local_img" ] && continue
repo="${local_img%:*}"
if [ -n "${keep_repo[$repo]:-}" ] && [ -z "${keep_exact[$local_img]:-}" ]; then
images_to_remove+=("$local_img")
fi
done < <(docker images --format '{{.Repository}}:{{.Tag}}' | grep -v '<none>')

if [ ${#images_to_remove[@]} -gt 0 ]; then
echo "Removing outdated versions of images pinned in $COMPOSE_FILE:"
printf " %s\n" "${images_to_remove[@]}"
docker rmi "${images_to_remove[@]}" -f
else
echo "No outdated versions found for images pinned in $COMPOSE_FILE."
fi

echo "docker image prune -f"
docker image prune -f
else
echo "Warning: $COMPOSE_FILE not found. Skipping selective image cleanup (no images removed)."
fi
else
echo "The docker image to delete does not exist."
echo "All docker images have already been deleted."
echo "All Docker images deleting..."
if [ -n "$(docker images -q)" ]; then
echo "docker rmi \$(docker images -q) -f"
docker rmi $(docker images -q) -f
else
echo "The docker image to delete does not exist."
echo "All docker images have already been deleted."
fi
fi

echo
Expand All @@ -36,10 +105,17 @@ else
fi

echo
# Clean up all unused Docker system resources (images, containers, networks, build cache)
echo "Cleaning up all unused Docker system resources (images, containers, networks, build cache)..."
echo "docker system prune -a -f"
docker system prune -a -f
# Clean up all unused Docker system resources (containers, networks, build cache,
# and -- unless --keep-current-images was given -- all unused images too)
if [ "$KEEP_CURRENT_IMAGES" = true ]; then
echo "Cleaning up unused Docker system resources (containers, networks, build cache)..."
echo "docker system prune -f"
docker system prune -f
else
echo "Cleaning up all unused Docker system resources (images, containers, networks, build cache)..."
echo "docker system prune -a -f"
docker system prune -a -f
fi

echo
# Delete all volumes
Expand Down
Loading