Updated readme and added install script
This commit is contained in:
parent
c3e9781dc4
commit
43e1cab315
6 changed files with 79 additions and 17 deletions
36
test/e2e/install.sh
Normal file
36
test/e2e/install.sh
Normal file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
|
||||
# This installation script works on Ubuntu 14.04 and 16.04
|
||||
# Run as root!
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "This script must be run as root" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
MYSQL_PASSWORD=`pwgen 12 -1`
|
||||
|
||||
# Setup MySQL user for Mailtrain Tests
|
||||
mysql -u root -e "CREATE USER 'mailtrain_test'@'localhost' IDENTIFIED BY '$MYSQL_PASSWORD';"
|
||||
mysql -u root -e "GRANT ALL PRIVILEGES ON mailtrain_test.* TO 'mailtrain_test'@'localhost';"
|
||||
mysql -u mailtrain_test --password="$MYSQL_PASSWORD" -e "CREATE database mailtrain_test;"
|
||||
|
||||
# Setup installation configuration
|
||||
cat >> config/test.toml <<EOT
|
||||
[www]
|
||||
port=3000
|
||||
[mysql]
|
||||
user="mailtrain_test"
|
||||
password="$MYSQL_PASSWORD"
|
||||
database="mailtrain_test"
|
||||
[testserver]
|
||||
enabled=true
|
||||
[seleniumwebdriver]
|
||||
browser="phantomjs"
|
||||
EOT
|
||||
|
||||
echo "Success! The test database has been created.";
|
Loading…
Add table
Add a link
Reference in a new issue