diff --git a/README.md b/README.md index 8b7d5db78..a8a85a3d8 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ Manual demo install and database setup: cp config/application-example.yml config/application.yml # and edit it cp config/database-example.yml config/database.yml # and edit it bundle exec rake db:setup:all # for production, please follow deployment howto + bundle exec rake:bootstrap bundle exec rake assets:precompile ### Apache with patched mod_epp (Debian 7/Ubuntu 14.04 LTS) diff --git a/db/seeds.rb b/db/seeds.rb index 441aa9442..5dde23342 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,36 +1,2 @@ # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). - -ActiveRecord::Base.transaction do - registrar = Registrar.create!( - name: 'Test', - reg_no: '1234', - street: 'test', - city: 'test', - state: 'test', - zip: '1234', - email: 'test@domain.tld', - country_code: 'US', - code: 'US1' - ) - - registrar.accounts.create!(account_type: Account::CASH, currency: 'EUR') - - ApiUser.create!( - username: 'test', - password: 'testtest', - identity_code: '51001091072', - active: true, - registrar: registrar, - roles: ['super'] - ) - - AdminUser.create!( - username: 'test', - email: 'test@domain.tld', - password: 'testtest', - password_confirmation: 'testtest', - country_code: 'US', - roles: ['admin'] - ) -end diff --git a/lib/tasks/bootstrap.rake b/lib/tasks/bootstrap.rake new file mode 100644 index 000000000..8bfff5ffc --- /dev/null +++ b/lib/tasks/bootstrap.rake @@ -0,0 +1,11 @@ +desc 'Bootstraps production-like environment' +task :bootstrap do + AdminUser.create!( + username: 'demo', + email: 'demo@domain.tld', + password: 'demodemo', + password_confirmation: 'demodemo', + country_code: 'US', + roles: ['admin'] + ) +end