Added email as argument in the rake task

This commit is contained in:
saurabhbhatia 2013-10-29 11:40:10 +08:00
parent 976c047a7f
commit b55a9ce535
1 changed files with 3 additions and 2 deletions

View File

@ -5,15 +5,16 @@ require 'open-uri'
require 'net/http/post/multipart'
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}"
username = "#{args.username}"
password = "#{args.password}"
email = "#{args.email}"
Site.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)
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
`mongo #{Mongoid.config.database.name} --eval "db.fs.chunks.ensureIndex({files_id: 1, n: 1})"`
puts "Congres you can now login within url"