From 125941d576a47418578cd893d97bfa64cfee2f17 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Wed, 20 Dec 2023 15:57:46 -0800 Subject: [PATCH] Use the local `db/dev.sqlite3` database in development mode (closes #84). --- .env.dev | 1 + Rakefile | 7 ++++++- scripts/server | 8 ++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .env.dev diff --git a/.env.dev b/.env.dev new file mode 100644 index 0000000..6fa3eff --- /dev/null +++ b/.env.dev @@ -0,0 +1 @@ +DATABASE_URL=sqlite3:db/dev.sqlite3 diff --git a/Rakefile b/Rakefile index 9c4e259..b9ab0e3 100644 --- a/Rakefile +++ b/Rakefile @@ -34,4 +34,9 @@ require 'kramdown/man/task' Kramdown::Man::Task.new require 'ronin/db/tasks' -Ronin::DB::Tasks.new +Ronin::DB::Tasks.new( + database: { + adapter: :sqlite3, + database: 'db/dev.sqlite3' + } +) diff --git a/scripts/server b/scripts/server index 0510267..c6d6bde 100755 --- a/scripts/server +++ b/scripts/server @@ -121,8 +121,12 @@ fi log "Starting Web server on localhost:${port} and Sidekiq ..." case "$environment" in - development) bundle exec foreman start -p "$port" -f Procfile.dev ;; - production) bundle exec foreman start -p "$port" ;; + development) + bundle exec foreman start -p "$port" -f Procfile.dev -e .env.dev + ;; + production) + bundle exec foreman start -p "$port" + ;; esac for pid in "${pids[@]}"; do