Commit be039a524f60cb80a732ce13b6fcdbd1a73f6e8e
1 parent
1a511c6c
Exists in
add_sisp_to_chef
Adds sisp:prepare Task to noosfero recipe
- Set up admin for sisp environment from config.yml Signed-off-by: Tallys Martins <tallysmartins@yahoo.com.br>
Showing
2 changed files
with
8 additions
and
2 deletions
Show diff stats
cookbooks/noosfero/recipes/default.rb
@@ -87,6 +87,12 @@ plugins_spb.each do |plugin| | @@ -87,6 +87,12 @@ plugins_spb.each do |plugin| | ||
87 | end | 87 | end |
88 | end | 88 | end |
89 | 89 | ||
90 | +execute 'sisp:environment:prepare' do | ||
91 | + command "RAILS_ENV=production bundle exec rake sisp:prepare ADMINUSER=#{node['config']['admins'].first[1]} DOMAIN=#{node['config']['sisp_external_hostname']}" | ||
92 | + cwd '/usr/lib/noosfero' | ||
93 | + user 'noosfero' | ||
94 | +end | ||
95 | + | ||
90 | execute 'plugins:activate' do | 96 | execute 'plugins:activate' do |
91 | command "RAILS_ENV=production bundle exec rake noosfero:plugins:enable_all" | 97 | command "RAILS_ENV=production bundle exec rake noosfero:plugins:enable_all" |
92 | cwd '/usr/lib/noosfero' | 98 | cwd '/usr/lib/noosfero' |
src/noosfero-spb/software_communities/lib/tasks/import_sisp_software.rake
@@ -32,7 +32,7 @@ namespace :sisp do | @@ -32,7 +32,7 @@ namespace :sisp do | ||
32 | create_link_blocks env | 32 | create_link_blocks env |
33 | env.save | 33 | env.save |
34 | 34 | ||
35 | - user = Environment.default.users.find_by_login(ENV["ADMINUSER"]) | 35 | + user = Environment.default.users.find_by_email(ENV["ADMINUSER"]) |
36 | if user.present? | 36 | if user.present? |
37 | password = SecureRandom.base64 | 37 | password = SecureRandom.base64 |
38 | sisp_user = env.users.find_by_login(user.login) | 38 | sisp_user = env.users.find_by_login(user.login) |
@@ -249,7 +249,7 @@ def create_institution sisp_hash | @@ -249,7 +249,7 @@ def create_institution sisp_hash | ||
249 | institution = PublicInstitution.find_or_initialize_by_name(name) | 249 | institution = PublicInstitution.find_or_initialize_by_name(name) |
250 | institution_community.name = name | 250 | institution_community.name = name |
251 | institution_community.country = "BR" | 251 | institution_community.country = "BR" |
252 | - institution_community.state = "DF" | 252 | + institution_community.state = "Distrito Federal" |
253 | institution_community.city = "Unknown" | 253 | institution_community.city = "Unknown" |
254 | institution_community.environment = $env | 254 | institution_community.environment = $env |
255 | institution_community.save! | 255 | institution_community.save! |