Added email as argument in the rake task
This commit is contained in:
parent
976c047a7f
commit
b55a9ce535
|
@ -5,15 +5,16 @@ require 'open-uri'
|
||||||
require 'net/http/post/multipart'
|
require 'net/http/post/multipart'
|
||||||
|
|
||||||
namespace :new_site do
|
namespace :new_site do
|
||||||
task :build, [:website_name, :username, :password] => :environment do |t, args|
|
task :build, [:website_name, :username, :password, :email] => :environment do |t, args|
|
||||||
website_name = "#{args.website_name}"
|
website_name = "#{args.website_name}"
|
||||||
username = "#{args.username}"
|
username = "#{args.username}"
|
||||||
password = "#{args.password}"
|
password = "#{args.password}"
|
||||||
|
email = "#{args.email}"
|
||||||
Site.destroy_all
|
Site.destroy_all
|
||||||
Purchase.destroy_all
|
Purchase.destroy_all
|
||||||
Site.create( :school => "#{website_name}", :department => 'Computer Science', :valid_locales => [ 'en', 'zh_tw' ], :in_use_locales => [ 'zh_tw', 'en' ], :frontend_open => true)
|
Site.create( :school => "#{website_name}", :department => 'Computer Science', :valid_locales => [ 'en', 'zh_tw' ], :in_use_locales => [ 'zh_tw', 'en' ], :frontend_open => true)
|
||||||
upload_package
|
upload_package
|
||||||
User.create!(:email=>'admin@rulingcom.com',:admin=>true,:user_id=>"#{username}",:password=>"#{password}")
|
User.create!(:email=>"#{email}",:admin=>true,:user_id=>"#{username}",:password=>"#{password}")
|
||||||
puts @user = User.last
|
puts @user = User.last
|
||||||
`mongo #{Mongoid.config.database.name} --eval "db.fs.chunks.ensureIndex({files_id: 1, n: 1})"`
|
`mongo #{Mongoid.config.database.name} --eval "db.fs.chunks.ensureIndex({files_id: 1, n: 1})"`
|
||||||
puts "Congres you can now login within url"
|
puts "Congres you can now login within url"
|
||||||
|
|
Reference in New Issue