Overhauled configuration so that it's a bit more useful in more spots; configuration now properly loads an environment config as well as defaults; updated some woodpecker config
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
13
Rakefile
13
Rakefile
@@ -3,18 +3,22 @@ require 'bundler/setup'
|
||||
namespace :db do
|
||||
desc 'Run migrations'
|
||||
task :migrate, [:version] do |t, args|
|
||||
require "sequel/core"
|
||||
require 'sequel/core'
|
||||
# load configuration
|
||||
require_relative 'src/config'
|
||||
conf = Config.new()
|
||||
|
||||
Sequel.extension :migration
|
||||
version = args[:version].to_i if args[:version]
|
||||
Sequel.connect('sqlite://data/gamedata.db') do |db|
|
||||
Sequel::Migrator.run(db, "db/migrations", target: version)
|
||||
Sequel.connect(adapter: conf.get('database.adapter'), database: conf.get('database.database')) do |db|
|
||||
Sequel::Migrator.run(db, 'db/migrations', target: version)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
namespace :server do
|
||||
task :start do
|
||||
ENV['APP_ENV'] = 'production'
|
||||
ENV['RACK_ENV'] = 'production'
|
||||
system("puma")
|
||||
end
|
||||
|
||||
@@ -32,4 +36,3 @@ namespace :test do
|
||||
system("rubocop src/ spec/")
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user