diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a67b93d457c7562d29ee887b24f124ec745fa43..02b94f1a3f085fe13a0844d0406a04589b6faab1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,4 +5,4 @@ linter: stage: test image: koalaman/shellcheck-alpine script: - - shellcheck setup.sh + - shellcheck **/*.sh diff --git a/README.md b/README.md index f2facd95a2c66b4aee19816e0604a64f7de9b143..493bdede4fd2d9f19ae22687718d99e158f85ca8 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ This repo is here to help installing Funkwhale using Docker. It follows the Prerequisites: * docker-compose +## Setup + To set up your instance, clone this repo and enter the directory, then run the script `./setup.sh`. @@ -18,9 +20,22 @@ pass them to it directly. See the help with this command: ./setup --help ``` +## Clean + +If you are doing tests, you might want to start from a blank slate each time. + +The `clean.sh` script cleans the Docker containers, their volumes and the +residual files. Since running the containers needs to create volume bindings, +this script needs sudo rights in order to clean the files created with root +access. + +Because of the security risk, please take a look at the script to understand +what it does: [`clean.sh`](./clean.sh) + ## Developer Prerequisites: * spellchecker + [docs-multi-container]: https://docs.funkwhale.audio/installation/docker.html#docker-multi-container diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000000000000000000000000000000000000..29a8c254ea92715fbb66481ce4a232ce45679ae4 --- /dev/null +++ b/clean.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +if [ -d funkwhale ]; then + pushd funkwhale + + docker-compose down + docker volume prune -f + + if [ -d data ]; then + sudo rm -rf data + fi + + popd + rm -rf funkwhale +fi + +if [ -d /srv/funkwhale ]; then + sudo rm -rf /srv/funkwhale +fi + +rm -rf templates