Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix failing bootstrapping #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/tasks/bootstrap.rake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace :bootstrap do
'add_flags_to_basic_pages',
'add_structure'
]

task :print_info do
Log.new.section "Bootstrapping: Creating basic groups and pages."
end
Expand Down Expand Up @@ -85,10 +85,10 @@ namespace :bootstrap do
p "Task: Adding Wingolfsblätter Abo Group"
Group.find_or_create_wbl_abo_group
end

task :add_structure => [:environment] do
p "Task: Add basic structure."
#
#
# root
# |--- intranet_root
# |----------- everyone
Expand All @@ -101,13 +101,13 @@ namespace :bootstrap do
# |---------------- help
#
Page.find_root << Page.find_intranet_root
Page.find_intranet_root << Group.find_corporations_parent_group
Page.find_intranet_root << Group.find_bvs_parent_group
Page.find_intranet_root << Page.find_help_page
Page.find_intranet_root << Group.everyone
Group.everyone << Group.find_corporations_parent_group
Group.everyone << Group.find_bvs_parent_group
Group.everyone << Group.hidden_users
Page.find_intranet_root << Group.find_corporations_parent_group
Page.find_intranet_root << Group.find_bvs_parent_group
Page.find_intranet_root << Page.find_help_page
end


Expand Down
26 changes: 13 additions & 13 deletions lib/tasks/import.rake
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
require 'importers/models/log'

namespace :import do

desc "Import all date from structure files and data files of the netenv system."
task :all do

tasks_to_execute = [
tasks_to_execute = [
'bootstrap:all',
'import:corporations',
'import:bvs',
'import:external_corporations',
'import:standard_workflows',
'import:workflows',
'import:group_profiles',
'import:users',
'cache:users'
]


$log = Log.new

$log.head "Wingolfsplattform Import System"
$log.info "Welcome. Please grab a beer and sit back."
$log.info "This script will import everything for you."

$log.section "Import files"
$log.info "Import folder: " + File.join(Rails.root, "import/")
$log.warning "Make sure the CSV files end with an empty line."

$log.section "Agenda"
display_agenda_for tasks_to_execute

execute tasks_to_execute

$log.section "Import Complete."
$log.info "All import tasks executed. We are done."
$log.info "Congratulations!"
$log.info ""
$log.info "You may now visit http://wingolfsplattform.org"
$log.info "to see the result of your hard work!"
$log.info ""

end

def display_agenda_for(tasks_to_execute)
system("bundle exec rake -T > /tmp/rake_toc")
tasks_to_execute.each do |task_to_execute|
system("cat /tmp/rake_toc |grep #{task_to_execute}")
end
end

def execute(tasks_to_execute)
tasks_to_execute.each do |task_to_execute|
Rake::Task[task_to_execute].invoke
end
end

end