make rake task more easier for service team
This commit is contained in:
parent
a88ad35641
commit
030d994180
|
@ -23,6 +23,30 @@ namespace :site do
|
|||
end
|
||||
|
||||
task :necessary_data => :environment do
|
||||
auto_setting
|
||||
site = Site.first
|
||||
site.title = 'RulingOrbit Demo Site'
|
||||
site.resque_namespace = @resque_namespace
|
||||
|
||||
# home_trans = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁')
|
||||
design = Design.first
|
||||
site = Site.first
|
||||
site.design = design
|
||||
site.save
|
||||
theme = design.themes.first
|
||||
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => theme.id )
|
||||
|
||||
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
||||
home.save
|
||||
|
||||
puts "Rember to restart server after you setup all sites for starting God"
|
||||
end
|
||||
|
||||
task :start_auto_setting => :environment do
|
||||
auto_setting
|
||||
end
|
||||
|
||||
def auto_setting
|
||||
puts "Enter your resque namespace[Orbit]:......"
|
||||
@resque_namespace = STDIN.gets.gsub("\n",'')
|
||||
@resque_namespace = APP_CONFIG['orbit'] if @resque_namespace.empty?
|
||||
|
@ -50,26 +74,11 @@ namespace :site do
|
|||
File.open("config/solr.god", 'w') { |file| file.write(solr_setting.result) }
|
||||
create_rulingcom_logrotate
|
||||
end
|
||||
end
|
||||
|
||||
site = Site.first
|
||||
site.title = 'RulingOrbit Demo Site'
|
||||
site.resque_namespace = @resque_namespace
|
||||
site.save
|
||||
|
||||
# home_trans = I18nVariable.create!( :document_class => 'Home', :key => 'home', :en => 'Homepage', :zh_tw => '首頁')
|
||||
design = Design.first
|
||||
site = Site.first
|
||||
site.design = design
|
||||
site.save
|
||||
theme = design.themes.first
|
||||
home = Page.new( :design_id => design.id, :name => 'home', :is_published => true, :theme_id => theme.id )
|
||||
|
||||
home.title_translations = {"zh_tw"=>"首頁", "en"=>"Home"}
|
||||
home.save
|
||||
|
||||
puts "Rember to restart server after you setup all sites for starting God"
|
||||
|
||||
def create_rulingcom_logrotate
|
||||
`sudo mkdir -p /var/log/rulingcom` unless File.directory? "/var/log/rulingcom"
|
||||
@project_folder = ENV["PWD"]
|
||||
puts "Is your Orbit folder: #{@project_folder} (If YES => Press enter,or enter your path)"
|
||||
user_enter_project_folder = STDIN.gets.gsub("\n",'')
|
||||
|
@ -87,5 +96,3 @@ namespace :site do
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue