aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-14 10:07:33 +0200
committerChocobozzz <me@florianbigard.com>2018-09-14 10:07:33 +0200
commit780daa7e91336116a5163156f298c9ad875ec1e3 (patch)
treed0dba7c6a87c71a7452af302a1ac6b5336d8036c
parentd5f044cef285e922244bef7851dbbc12a61ec11f (diff)
downloadPeerTube-780daa7e91336116a5163156f298c9ad875ec1e3.tar.gz
PeerTube-780daa7e91336116a5163156f298c9ad875ec1e3.tar.zst
PeerTube-780daa7e91336116a5163156f298c9ad875ec1e3.zip
Speaup clean script
-rwxr-xr-xscripts/clean/server/test.sh26
1 files changed, 20 insertions, 6 deletions
diff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.sh
index 5f9a88a2e..235ff52cc 100755
--- a/scripts/clean/server/test.sh
+++ b/scripts/clean/server/test.sh
@@ -2,14 +2,28 @@
2 2
3set -eu 3set -eu
4 4
5for i in $(seq 1 6); do 5recreateDB () {
6 dbname="peertube_test$i" 6 dbname="peertube_test$1"
7 7
8 dropdb --if-exists "$dbname" 8 dropdb --if-exists "$dbname"
9 rm -rf "./test$i" "./config/local-test.json" "./config/local-test-$i.json"
10 9
11 createdb -O peertube "$dbname" 10 createdb -O peertube "$dbname"
12 psql -c "CREATE EXTENSION pg_trgm;" "$dbname" 11 psql -c "CREATE EXTENSION pg_trgm;" "$dbname" &
13 psql -c "CREATE EXTENSION unaccent;" "$dbname" 12 psql -c "CREATE EXTENSION unaccent;" "$dbname" &
14 redis-cli KEYS "bull-localhost:900$i*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL 13}
14
15removeFiles () {
16 rm -rf "./test$1" "./config/local-test.json" "./config/local-test-$1.json"
17}
18
19dropRedis () {
20 redis-cli KEYS "bull-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL
21}
22
23for i in $(seq 1 6); do
24 recreateDB "$i" &
25 dropRedis "$i" &
26 removeFiles "$i" &
15done 27done
28
29wait