diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-03-07 18:06:54 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-03-07 18:06:54 +0100 |
commit | e7870ff368251c6368137aab4f670517b37a2a20 (patch) | |
tree | 74c575eb114bb12788465629f194f03d218397d7 | |
parent | ccfd23dfe5c0ede1958804e8a36b4b336307a67e (diff) | |
download | PeerTube-e7870ff368251c6368137aab4f670517b37a2a20.tar.gz PeerTube-e7870ff368251c6368137aab4f670517b37a2a20.tar.zst PeerTube-e7870ff368251c6368137aab4f670517b37a2a20.zip |
Move scripts to bin
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | bin/clean_test.sh | 8 | ||||
-rwxr-xr-x | bin/run_servers.sh | 12 |
3 files changed, 22 insertions, 2 deletions
@@ -76,8 +76,8 @@ Install NodeJS 4.2: [https://nodejs.org/en/download/package-manager/#debian-and- | |||
76 | 76 | ||
77 | ### Test with 3 fresh nodes | 77 | ### Test with 3 fresh nodes |
78 | 78 | ||
79 | $ scripts/clean_test.sh | 79 | $ bin/clean_test.sh |
80 | $ scripts/run_servers.sh | 80 | $ bin/run_servers.sh |
81 | 81 | ||
82 | Then you will can access to the three nodes at `http://localhost:900{1,2,3}`. If you call "make friends" on `http://localhost:9002`, the pod 2 and 3 will become friends. Then if you call "make friends" on `http://localhost:9001` it will become friend with the pod 2 and 3 (check the configuration files). Then the pod will communicate with each others. If you add a video on the pod 3 you'll can see it on the pod 1 and 2 :) | 82 | Then you will can access to the three nodes at `http://localhost:900{1,2,3}`. If you call "make friends" on `http://localhost:9002`, the pod 2 and 3 will become friends. Then if you call "make friends" on `http://localhost:9001` it will become friend with the pod 2 and 3 (check the configuration files). Then the pod will communicate with each others. If you add a video on the pod 3 you'll can see it on the pod 1 and 2 :) |
83 | 83 | ||
diff --git a/bin/clean_test.sh b/bin/clean_test.sh new file mode 100755 index 000000000..ef146e091 --- /dev/null +++ b/bin/clean_test.sh | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | basePath=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) | ||
4 | |||
5 | for i in $(seq 1 6); do | ||
6 | printf "use peertube-test%s;\ndb.dropDatabase();" "$i" | mongo | ||
7 | rm -rf "$basePath/../test$i" | ||
8 | done | ||
diff --git a/bin/run_servers.sh b/bin/run_servers.sh new file mode 100755 index 000000000..83768178c --- /dev/null +++ b/bin/run_servers.sh | |||
@@ -0,0 +1,12 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | if [ ! -f server.js ]; then | ||
4 | echo "The script has to be executed at the root of the project." | ||
5 | exit -1 | ||
6 | fi | ||
7 | |||
8 | NODE_ENV=test NODE_APP_INSTANCE=1 node server.js & | ||
9 | sleep 1 | ||
10 | NODE_ENV=test NODE_APP_INSTANCE=2 node server.js & | ||
11 | sleep 1 | ||
12 | NODE_ENV=test NODE_APP_INSTANCE=3 node server.js & | ||