-
Notifications
You must be signed in to change notification settings - Fork 3
/
Rakefile
36 lines (28 loc) · 986 Bytes
/
Rakefile
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
36
$LOAD_PATH.unshift 'lib'
require 'resque/tasks'
task :environment, :env do |cmd, args|
ENV["RACK_ENV"] ||= args[:env] || "development"
require 'crowdring'
end
namespace :db do
task :migrate, :env do |cmd, args|
env = args[:env] || "development"
Rake::Task['environment'].invoke(env)
database_url = ENV["DATABASE_URL"] || "postgres://localhost/crowdring_#{env}"
DataMapper.setup(:default, database_url)
DataMapper.finalize
DataMapper.auto_upgrade!
end
task :reset, :env do |cmd, args|
env = args[:env] || "development"
Rake::Task['environment'].invoke(env)
database_url = ENV["DATABASE_URL"] || "postgres://localhost/crowdring_#{env}"
DataMapper.setup(:default, database_url)
DataMapper.finalize
DataMapper.auto_migrate!
User.set(
email: ENV["ADMIN_EMAIL"] || '[email protected]',
password: ENV["ADMIN_PASSWORD"] || 'gAnd0lf',
password_confirmation: ENV["ADMIN_PASSWORD"] || 'gAnd0lf')
end
end