-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathci_script
More file actions
executable file
·35 lines (27 loc) · 1 KB
/
ci_script
File metadata and controls
executable file
·35 lines (27 loc) · 1 KB
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
#!/usr/bin/env bash
set -e
echo "Start MySQL..."
sudo systemctl start mysql
echo "Create blank database..."
SQL="mysql -uroot -proot -e"
$SQL "CREATE DATABASE pdf;"
$SQL "CREATE USER 'webuser'@'localhost' IDENTIFIED BY 'password';"
$SQL "USE pdf; GRANT ALL PRIVILEGES ON pdf.* TO 'webuser'@'localhost';"
echo "Configure lighttpd..."
sudo cp lighttpd-pdfreview-ci.conf /etc/lighttpd/conf-available/95-pdf-rev.conf
sudo chown -R $USER:www-data /home/runner
sudo lighty-enable-mod cgi
sudo lighty-enable-mod pdf-rev
sudo ln -s $GITHUB_WORKSPACE /var/www/html/pdfreview
echo "Configure pdfreview and install dependencies..."
mv config_ci.py config.py
pip install -r requirements.txt
npm install
echo "Create DB schema..."
alembic upgrade head
echo '"""Fix""" permissions and restart server...'
sudo chmod -R 777 /home/runner # yeah, it's overkill, I know, but I'm tired of debugging permissions errors when lighttpd doesn't make that easy at all
sudo systemctl restart lighttpd.service
set +e
echo "Run tests..."
./run_tests