Merge branch 'master' of github.com:bryanpedini-docker/mediawiki-compose

This commit is contained in:
Bryan Joshua Pedini 2020-03-09 11:28:54 +01:00
commit 295a3f4eca
1 changed files with 19 additions and 5 deletions

View File

@ -10,7 +10,7 @@ cat << "EOF"
EOF
function show_help () {
echo "Usage: $0 [help] [install] [start] [stop] [full-upgrade]"
echo "Usage: $0 [help] <install | start | stop | full-upgrade | uninstall>"
cat << "EOF"
Parameters:
help: Displays this help message and exits.
@ -23,6 +23,8 @@ function show_help () {
full-upgrade: Deletes the servers and their images, maintaining the data, recreates everything from scratch and exits.
uninstall: Deletes the servers and their images, and all the data if necessary and exits.
EOF
}
@ -37,23 +39,35 @@ for par in "$@"; do
exit 0
;;
"start")
docker-compose up -d
docker-compose start -d
exit 0
;;
"stop")
docker-compose down
docker-compose stop
exit 0
;;
"full-upgrade")
docker-compose down
docker network rm mediawiki
docker rmi mediawiki:1.34
docker rmi percona:8.0
docker pull mediawiki:1.34
docker pull percona:8.0
docker-compose up -d
exit 0
;;
"uninstall")
docker-compose down
docker rmi mediawiki:1.34
read -p "Do you also whish to delete all the data stored in the database (requires sudo permission)? <y | n> [n]" DELETE_DATA
case "$DELETE_DATA" in
"y" | "Y")
sudo rm -rf data/db/* -v ".gitignore"
;;
*)
exit 0
;;
esac
exit 0
;;
esac
done