2015-11-22 08:40:57 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2016-07-07 04:38:07 +03:00
|
|
|
set -evuo pipefail
|
2015-11-22 08:40:57 +03:00
|
|
|
|
|
|
|
node ./scripts/gen_keys.js
|
|
|
|
|
|
|
|
# Force install of mysql-patcher
|
|
|
|
(cd node_modules/fxa-auth-db-mysql && npm install &>/var/tmp/db-mysql.out)
|
|
|
|
|
2016-04-13 21:52:14 +03:00
|
|
|
mysql -u root -e 'DROP DATABASE IF EXISTS fxa'
|
2015-11-22 08:40:57 +03:00
|
|
|
node ./node_modules/fxa-auth-db-mysql/bin/db_patcher.js
|
|
|
|
|
|
|
|
# Start backgrounded fxa-auth-db-mysql server
|
|
|
|
nohup node ./node_modules/fxa-auth-db-mysql/bin/server.js &>>/var/tmp/db-mysql.out &
|
|
|
|
|
|
|
|
# Give auth-db-mysql a moment to start up
|
|
|
|
sleep 5
|
|
|
|
|
2015-11-23 06:56:38 +03:00
|
|
|
# If either the curl fails to get a response, or the grep fails to match, this
|
|
|
|
# script will exit non-zero and fail the test run.
|
|
|
|
authdb_version=$(curl -s http://127.0.0.1:8000/__version__)
|
|
|
|
echo $authdb_version | grep '"implementation":"MySql"'
|