This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main'
- Loading branch information
Showing
6 changed files
with
43 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
#!/bin/bash | ||
|
||
make down | ||
# Get all container IDs connected to the 'prem-gateway' network | ||
CONTAINERS=($(docker ps -aq --filter network=prem-gateway)) | ||
|
||
cd ./script | ||
# Check if CONTAINERS is empty (no containers on the network) | ||
if [ ${#CONTAINERS[@]} -eq 0 ]; then | ||
echo "No containers found on the 'prem-gateway' network." | ||
else | ||
# Stop all containers | ||
echo "Stopping containers on 'prem-gateway' network..." | ||
for CONTAINER in "${CONTAINERS[@]}"; do | ||
docker stop "$CONTAINER" | ||
done | ||
|
||
export PREMD_IMAGE | ||
export PREMAPP_IMAGE | ||
docker-compose -f docker-compose-box.yml down -v | ||
# Remove all containers and their anonymous volumes | ||
echo "Removing containers and cleaning up volumes..." | ||
for CONTAINER in "${CONTAINERS[@]}"; do | ||
docker rm -v "$CONTAINER" | ||
done | ||
|
||
echo "Containers stopped and removed. Volumes cleaned." | ||
fi |