forked from codeforanchorage/courtbot
-
Notifications
You must be signed in to change notification settings - Fork 10
/
run-cucumber
executable file
·36 lines (36 loc) · 1.43 KB
/
run-cucumber
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
28
29
30
31
32
33
34
35
36
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Continuing execution even if command fails..."
else
set -ev
echo "Running in travis mode..."
fi
[ -f .env ] && mv .env .env.old || echo Skipping .env backup
echo "OSCN_API_URL=http://localhost:5050/oscn" >> .env
echo "COOKIE_SECRET=insert-random-string" >> .env
echo "TWILIO_API_HOST=http://localhost:5050/twilio" >> .env
echo "TWILIO_LOOKUPS_HOST=http://localhost:5050/twilioLookups" >> .env
echo "TWILIO_ACCOUNT=TWILIOSID" >> .env
echo "TWILIO_AUTH_TOKEN=TWILIOTOKEN" >> .env
echo "TWILIO_PHONE_NUMBER=+15555555555" >> .env
echo "DATABASE_URL=postgres://postgres:$PGPASSWORD@localhost:5432/courtbotat" >> .env
echo "QUEUE_TTL_DAYS=10" >> .env
echo "COURTBOT_TITLE=Tulsa Courtbot" >> .env
echo "REMINDER_DAYS_OUT=1" >> .env
echo "COURT_PUBLIC_URL=http://www.oscn.net/v4/" >> .env
echo "COURTBOOK_URL=https://courtbook.herokuapp.com" >> .env
echo "COURTBOOK_OAUTH_SECRET=oauth_secret" >> .env
echo "COURTBOOK_OAUTH_CLIENT_ID=oauth_client_id" >> .env
echo "COURTBOOK_OAUTH_AUDIENCE=oauth_audience" >> .env
echo "COURTBOOK_OAUTH_TOKEN_URL=oauth_token_url" >> .env
echo "API_TOKENS=[\"TOKEN1\", \"TOKEN2\"]" >> .env
cat .env
psql -c "CREATE DATABASE courtbotat" -h localhost -U postgres
node web.js &
sleep 5
./node_modules/.bin/cucumber-js -f json:cucumber_report.json
pkill node
rm .env
psql -c "DROP DATABASE courtbotat" -h localhost -U postgres
[ -f .env.old ] && mv .env.old .env || echo Skipping .env restore