diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-20 16:24:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-20 16:24:31 +0200 |
commit | 0491173a61aed66205c017e0d7e0503ea316c144 (patch) | |
tree | ce6621597505f9518cfdf0981977d097c63f9fad /scripts/clean | |
parent | 8704acf49efc770d73bf07c10468ed8c74d28a83 (diff) | |
parent | 6247b2057b792cea155a1abd9788c363ae7d2cc2 (diff) | |
download | PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.gz PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.tar.zst PeerTube-0491173a61aed66205c017e0d7e0503ea316c144.zip |
Merge branch 'develop' into cli-wrapper
Diffstat (limited to 'scripts/clean')
-rwxr-xr-x | scripts/clean/server/test.sh | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/scripts/clean/server/test.sh b/scripts/clean/server/test.sh index 3b8fe39ed..235ff52cc 100755 --- a/scripts/clean/server/test.sh +++ b/scripts/clean/server/test.sh | |||
@@ -2,15 +2,28 @@ | |||
2 | 2 | ||
3 | set -eu | 3 | set -eu |
4 | 4 | ||
5 | for i in $(seq 1 6); do | 5 | recreateDB () { |
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" | 9 | |
10 | rm -f "./config/local-test.json" | ||
11 | rm -f "./config/local-test-$i.json" | ||
12 | createdb -O peertube "$dbname" | 10 | createdb -O peertube "$dbname" |
13 | psql -c "CREATE EXTENSION pg_trgm;" "$dbname" | 11 | psql -c "CREATE EXTENSION pg_trgm;" "$dbname" & |
14 | psql -c "CREATE EXTENSION unaccent;" "$dbname" | 12 | psql -c "CREATE EXTENSION unaccent;" "$dbname" & |
15 | redis-cli KEYS "bull-localhost:900$i*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL | 13 | } |
14 | |||
15 | removeFiles () { | ||
16 | rm -rf "./test$1" "./config/local-test.json" "./config/local-test-$1.json" | ||
17 | } | ||
18 | |||
19 | dropRedis () { | ||
20 | redis-cli KEYS "bull-localhost:900$1*" | grep -v empty | xargs --no-run-if-empty redis-cli DEL | ||
21 | } | ||
22 | |||
23 | for i in $(seq 1 6); do | ||
24 | recreateDB "$i" & | ||
25 | dropRedis "$i" & | ||
26 | removeFiles "$i" & | ||
16 | done | 27 | done |
28 | |||
29 | wait | ||