diff --git a/.docker/init.sh b/.docker/init.sh index 377ccd1..a090f38 100644 --- a/.docker/init.sh +++ b/.docker/init.sh @@ -32,9 +32,9 @@ if [ "$ULOGGER_DB_DRIVER" = "pgsql" ]; then su postgres -c "pg_ctl -w stop" sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"pgsql:host=localhost;port=5432;dbname=ulogger\";/" /var/www/html/config.php elif [ "$ULOGGER_DB_DRIVER" = "sqlite" ]; then - mkdir -p /data - chown nobody:nobody /data - sqlite3 -init /var/www/html/scripts/ulogger.sqlite /data/ulogger.db + mkdir -p /data/sqlite + chown -R nobody:nobody /data + 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')" sed -i "s/^\$dbdsn = .*$/\$dbdsn = \"sqlite:\/data\/sqlite\/ulogger.db\";/" /var/www/html/config.php else diff --git a/.travis.yml b/.travis.yml index 8ff9e6b..16a5b9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,7 +32,12 @@ before_install: docker run -d --name ulogger -p 8080:80 -p 8081:5432 --expose 5432 ulogger ;; 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 run -d --name ulogger -p 8080:80 -v /tmp/data:/data ulogger ;;