Created
July 25, 2023 13:31
-
-
Save Bouni/b049d21bfa9b35263e62c7a963e25fc2 to your computer and use it in GitHub Desktop.
A shell script to handle mutiple docker-compose files easily
This file contains hidden or 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
#!/bin/sh | |
case $1 in | |
"update" ) | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') pull --ignore-pull-failures && \ | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') up -d;; | |
"status" ) | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') ps -a;; | |
"lf" ) | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') logs -f ${@:2};; | |
"clean" ) | |
docker system prune --volumes;; | |
*) | |
docker-compose $(find . -maxdepth 2 -name compose.*.yaml -type f -print | sed -e 's/^/-f /') $*;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment