Fix travis sqlite build
This commit is contained in:
parent
0ce633a3bf
commit
bc1b58049a
@ -32,9 +32,9 @@ if [ "$ULOGGER_DB_DRIVER" = "pgsql" ]; then
|
|||||||
su postgres -c "pg_ctl -w stop"
|
su postgres -c "pg_ctl -w stop"
|
||||||
sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"pgsql:host=localhost;port=5432;dbname=ulogger\";/" /var/www/html/config.php
|
sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"pgsql:host=localhost;port=5432;dbname=ulogger\";/" /var/www/html/config.php
|
||||||
elif [ "$ULOGGER_DB_DRIVER" = "sqlite" ]; then
|
elif [ "$ULOGGER_DB_DRIVER" = "sqlite" ]; then
|
||||||
mkdir -p /data
|
mkdir -p /data/sqlite
|
||||||
chown nobody:nobody /data
|
chown -R nobody:nobody /data
|
||||||
sqlite3 -init /var/www/html/scripts/ulogger.sqlite /data/ulogger.db
|
sqlite3 -init /var/www/html/scripts/ulogger.sqlite /data/sqlite/ulogger.db
|
||||||
sqlite3 -line /data/ulogger.db "INSERT INTO users (login, password) VALUES ('admin', '\$2y\$10\$7OvZrKgonVZM9lkzrTbiou.CVhO3HjPk5y0W9L68fVwPs/osBRIMq')"
|
sqlite3 -line /data/ulogger.db "INSERT INTO users (login, password) VALUES ('admin', '\$2y\$10\$7OvZrKgonVZM9lkzrTbiou.CVhO3HjPk5y0W9L68fVwPs/osBRIMq')"
|
||||||
sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"sqlite:\/data\/sqlite\/ulogger.db\";/" /var/www/html/config.php
|
sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"sqlite:\/data\/sqlite\/ulogger.db\";/" /var/www/html/config.php
|
||||||
else
|
else
|
||||||
|
@ -32,7 +32,12 @@ before_install:
|
|||||||
docker run -d --name ulogger -p 8080:80 -p 8081:5432 --expose 5432 ulogger
|
docker run -d --name ulogger -p 8080:80 -p 8081:5432 --expose 5432 ulogger
|
||||||
;;
|
;;
|
||||||
sqlite*)
|
sqlite*)
|
||||||
mkdir -p /tmp/data
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install sqlite3
|
||||||
|
mkdir -p /tmp/data/sqlite
|
||||||
|
sqlite3 -init scripts/ulogger.sqlite /data/sqlite/ulogger.db
|
||||||
|
sudo chown -R travis:travis /tmp/data
|
||||||
|
sudo chmod -R 777 /tmp/data
|
||||||
docker build -t ulogger --build-arg DB_DRIVER=sqlite .
|
docker build -t ulogger --build-arg DB_DRIVER=sqlite .
|
||||||
docker run -d --name ulogger -p 8080:80 -v /tmp/data:/data ulogger
|
docker run -d --name ulogger -p 8080:80 -v /tmp/data:/data ulogger
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user