-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.sh
27 lines (20 loc) · 1.05 KB
/
dev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
PARSER_HOST=$(node test/param.js test.parser.host)
PARSER_PORT=$(node test/param.js test.parser.port)
TESTEN_HOST=$(node test/param.js test.testendpoints.host)
TESTEN_PORT=$(node test/param.js test.testendpoints.port)
echo 'killing processes...';
kill -SIGTERM $(ps aux | grep "testmode" | grep -v grep | head -1 | awk '{print $2}') &> /dev/null && echo 'killed' || echo 'nothing to kill'
kill -SIGTERM $(ps aux | grep "testmode" | grep -v grep | head -1 | awk '{print $2}') &> /dev/null
kill -SIGTERM $(ps aux | grep "testmode" | grep -v grep | head -1 | awk '{print $2}') &> /dev/null
echo -e "\n\n";
echo 'starting servers...';
npm run start ${PARSER_HOST} ${PARSER_PORT} testmode & disown
cd test
node server.js ${TESTEN_HOST} ${TESTEN_PORT} testmode & disown
cd ..
sleep 3
echo -e "\n\n";
echo 'testing servers...';
curl "${PARSER_HOST}:${PARSER_PORT}" &> /dev/null && echo 'PARSER : working' || echo 'PARSER : not working';
curl "${TESTEN_HOST}:${TESTEN_PORT}" &> /dev/null && echo 'TESTSERVER : working' || echo 'TESTSERVER : not working';