remove setup_dev script to avoid confusion
This commit is contained in:
parent
fcdb7f36b7
commit
38864a8303
|
@ -1,52 +0,0 @@
|
||||||
#!/usr/bin/env ruby
|
|
||||||
|
|
||||||
root = File.expand_path('../../', __FILE__)
|
|
||||||
|
|
||||||
|
|
||||||
puts "Setting up local development environment!"
|
|
||||||
puts
|
|
||||||
|
|
||||||
Dir.chdir root
|
|
||||||
|
|
||||||
puts "Running: bundle"
|
|
||||||
system "bundle"
|
|
||||||
|
|
||||||
|
|
||||||
database_yml = root + '/config/database.yml'
|
|
||||||
|
|
||||||
if !File.exists?(database_yml)
|
|
||||||
puts "Creating config/database.yml"
|
|
||||||
system "cp #{root}/config/database.yml.development-sample #{database_yml}"
|
|
||||||
|
|
||||||
puts "Creating development database"
|
|
||||||
system "bundle exec rake db:create"
|
|
||||||
|
|
||||||
puts "Migrating development database"
|
|
||||||
system "bundle exec rake db:migrate"
|
|
||||||
|
|
||||||
puts "Creating test database"
|
|
||||||
system "RAILS_ENV=test bundle exec rake db:create"
|
|
||||||
|
|
||||||
puts "Migrating test database"
|
|
||||||
system "RAILS_ENV=test bundle exec rake db:migrate"
|
|
||||||
end
|
|
||||||
|
|
||||||
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
|
||||||
|
|
||||||
if User.count == 0
|
|
||||||
puts "Setting up an admin user"
|
|
||||||
admin = User.new
|
|
||||||
admin.email = "admin@localhost"
|
|
||||||
admin.username = "admin"
|
|
||||||
admin.password = "password"
|
|
||||||
admin.save
|
|
||||||
admin.grant_admin!
|
|
||||||
admin.change_trust_level!(:regular)
|
|
||||||
admin.email_tokens.update_all(confirmed: true)
|
|
||||||
|
|
||||||
puts "An administrator was created:"
|
|
||||||
puts "Username: admin"
|
|
||||||
puts "Password: password"
|
|
||||||
puts
|
|
||||||
puts "To get started run: bundle exec thin start"
|
|
||||||
end
|
|
Loading…
Reference in New Issue