diff --git a/script/apply-template b/script/apply-template index 7c60d71..ee0f2bf 100755 --- a/script/apply-template +++ b/script/apply-template @@ -17,11 +17,16 @@ when 'active-enterprise' when 'community' communities = Community.find(:all) - [Community['espaco'], Community['anarquismo']] communities.each { |community| + puts 'c: ' + community.identifier community.apply_template(env.community_template) - blog = community.blog - community.articles.select{|i| !i.blog? or i != blog.feed}.each{ |article| - article.parent = blog - article.save! + community.reload + puts 'template applied' + community.articles.each { |article| + puts 'including ' + article.path + ' in the blog' + if !article.blog? && !article.is_a?(RssFeed) + article.parent_id = community.blog.id + article.save! + end } } end diff --git a/script/release-v0.13.0-ecosol b/script/release-v0.13.0-ecosol index b36da53..86a5e01 100755 --- a/script/release-v0.13.0-ecosol +++ b/script/release-v0.13.0-ecosol @@ -1,6 +1,10 @@ #!/bin/sh -export RAILS_ENV=production +if [ -x $RAILS_ENV ]; then + export RAILS_ENV=production +fi + +echo "Rails environment: $RAILS_ENV" echo 'Creating Big images...' script/generate-profile-big-images @@ -73,7 +77,7 @@ script/runner 'env = Environment.default; echo 'ATENCAO: Copie o tema (via scp) empreendimento-solidario para public/designs/themes/' echo ' Nao esqueca de copiar o footer.rhtml do tema default' echo ' (e pressione ENTER para continuar)' -read +read INPUT echo 'Applying empreendimento-solidario theme...' script/runner 'c = Enterprise.connection; @@ -120,7 +124,7 @@ echo 'Schedule task-nitifier script...' echo 'ATENCAO: Agende o script task-notifier no crontab para executar mensalmente' echo ' Não esqueça de setar no environment.rb o ambiente para production' echo ' (pressione ENTER para continuar)' -read +read INPUT echo 'Disabling CMS...' script/runner 'env = Environment.default diff --git a/script/test-0.13 b/script/test-0.13 new file mode 100755 index 0000000..06d2ac8 --- /dev/null +++ b/script/test-0.13 @@ -0,0 +1,13 @@ +#!/bin/sh + +rm -f db/*.db +find public/images/ -name \*big\* -delete +rake db:schema:load +rake db:populate +ruby script/anhetegua + +./script/runner ' + Enterprise.create!(:name => "Desabilitada", :identifier => "desabilitada", :enabled => false, :environment => Environment.default) +' + +RAILS_ENV=development script/release-v0.13.0-ecosol -- libgit2 0.21.2