]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Move scripts to bin
authorChocobozzz <florian.bigard@gmail.com>
Mon, 7 Mar 2016 17:06:54 +0000 (18:06 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Mon, 7 Mar 2016 17:06:54 +0000 (18:06 +0100)
README.md
bin/clean_test.sh [new file with mode: 0755]
bin/run_servers.sh [new file with mode: 0755]

index 0477f3485996a6e20eb99fa376157b7bb92c0274..8cae42aab5239dc64dc646b8678cef728d4b61a4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -76,8 +76,8 @@ Install NodeJS 4.2: [https://nodejs.org/en/download/package-manager/#debian-and-
 
 ### Test with 3 fresh nodes
 
-    $ scripts/clean_test.sh
-    $ scripts/run_servers.sh
+    $ bin/clean_test.sh
+    $ bin/run_servers.sh
 
 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 :)
 
diff --git a/bin/clean_test.sh b/bin/clean_test.sh
new file mode 100755 (executable)
index 0000000..ef146e0
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+basePath=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+
+for i in $(seq 1 6); do
+  printf "use peertube-test%s;\ndb.dropDatabase();" "$i" | mongo
+  rm -rf "$basePath/../test$i"
+done
diff --git a/bin/run_servers.sh b/bin/run_servers.sh
new file mode 100755 (executable)
index 0000000..8376817
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [ ! -f server.js ]; then
+  echo "The script has to be executed at the root of the project."
+  exit -1
+fi
+
+NODE_ENV=test NODE_APP_INSTANCE=1 node server.js &
+sleep 1
+NODE_ENV=test NODE_APP_INSTANCE=2 node server.js &
+sleep 1
+NODE_ENV=test NODE_APP_INSTANCE=3 node server.js &