stop and remove containers and pods first
Some checks failed
Podman Rootless Demo / test-backend (push) Has been skipped
Podman Rootless Demo / test-frontend (push) Successful in 11s
Podman Rootless Demo / build-backend (push) Has been skipped
Podman Rootless Demo / build-frontend (push) Failing after 29s
Podman Rootless Demo / deploy-prod (push) Has been skipped

This commit is contained in:
continuist 2025-09-21 14:03:11 -04:00
parent 5fe8dd3d0f
commit ef2b5b70fc

View file

@ -197,6 +197,21 @@ jobs:
--password-stdin \
"${{ secrets.REGISTRY_HOST }}"
- name: Force cleanup all containers and pods
run: |
set -x
echo "=== Force stopping all containers ==="
podman --remote ps -aq | xargs -r podman --remote stop --time 5 2>/dev/null || true
echo "=== Force removing all containers ==="
podman --remote ps -aq | xargs -r podman --remote rm -f 2>/dev/null || true
echo "=== Force stopping all pods ==="
podman --remote pod ps -q | xargs -r podman --remote pod stop --time 5 2>/dev/null || true
echo "=== Force removing all pods ==="
podman --remote pod ps -q | xargs -r podman --remote pod rm -f 2>/dev/null || true
- name: Disk preflight diagnostic
run: |
echo "=== Podman storage info ==="
@ -210,25 +225,9 @@ jobs:
- name: Safe storage pruning
run: |
set -x # Enable debug output
# List and remove any running containers first
echo "=== Removing running containers ==="
containers=$(podman --remote ps -aq)
if [ -n "$containers" ]; then
echo "Found containers: $containers"
for container in $containers; do
echo "Attempting to remove container: $container"
# Try to stop first with timeout, then remove
timeout 10s podman --remote stop "$container" 2>/dev/null || echo "Timeout or error stopping container $container"
timeout 5s podman --remote rm -f "$container" 2>/dev/null || echo "Warning: Could not remove container $container"
done
else
echo "No containers found to remove"
fi
set -x
echo "=== Pruning system ==="
podman --remote system prune -f || echo "Pruning completed with warnings"
podman --remote system prune -f
echo "=== Storage status after pruning ==="
podman --remote system df