Commit b90b14e2d437e38b268f1c9b9beabfae7b955c9b
Exists in
staging
and in
42 other branches
Merge branch 'merge-requests/189'
Showing
6 changed files
with
85 additions
and
54 deletions
Show diff stats
lib/tasks/data.rake
| 1 | 1 | namespace :db do |
| 2 | 2 | namespace :data do |
| 3 | 3 | task :minimal do |
| 4 | - require File.join(RAILS_ROOT, 'config', 'environment.rb') | |
| 5 | - environment = Environment.create!(:name => 'Noosfero', :is_default => true) | |
| 4 | + sh './script/runner', "Environment.create!(:name => 'Noosfero', :is_default => true)" | |
| 6 | 5 | unless ENV['NOOSFERO_DOMAIN'].blank? |
| 7 | - environment.domains << Domain.new(:name => ENV['NOOSFERO_DOMAIN']) | |
| 6 | + sh './script/runner', "environment.domains << Domain.new(:name => ENV['NOOSFERO_DOMAIN'])" | |
| 8 | 7 | end |
| 9 | 8 | end |
| 10 | 9 | end | ... | ... |
public/designs/themes/base/style.css
| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | +# needed to run noosfero | |
| 2 | +runtime_dependencies=$(sed -e '1,/^Depends:/d; /^Recommends:/,$ d; s/([^)]*)//g; s/,\s*/\n/g' debian/control | grep -v 'memcached\|debconf\|dbconfig-common\|postgresql\|misc:Depends\|adduser\|mail-transport-agent') | |
| 3 | +run sudo apt-get -y install $runtime_dependencies | |
| 4 | + | |
| 5 | +# needed for development | |
| 6 | +run sudo apt-get -y install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb libxml2-dev libxslt-dev | |
| 7 | +gem which bundler >/dev/null 2>&1 || run gem install bundler | |
| 8 | +run bundle install | ... | ... |
| ... | ... | @@ -0,0 +1,70 @@ |
| 1 | +#!/bin/sh | |
| 2 | + | |
| 3 | +say() { | |
| 4 | + msg="$@" | |
| 5 | + printf "\033[33;01m%s\033[m\n" "$msg" | |
| 6 | +} | |
| 7 | + | |
| 8 | +complain() { | |
| 9 | + msg="$@" | |
| 10 | + printf "\033[1;31;40m%s\033[m\n" "$msg" | |
| 11 | +} | |
| 12 | + | |
| 13 | +run() { | |
| 14 | + say "\$ $@" | |
| 15 | + echo "$@" | sh | |
| 16 | + status="$?" | |
| 17 | + if [ $status -ne 0 ]; then | |
| 18 | + complain "E: The command \"$@\" failed with status code $status, we cannot proceed." | |
| 19 | + complain "I: If you have no idea of what went wrong, please feel free to ask for help in the Noosfero community. Check the contact information in the project website (http://noosfero.org/)." | |
| 20 | + exit 1 | |
| 21 | + fi | |
| 22 | +} | |
| 23 | + | |
| 24 | +if gem which system_timer >/dev/null 2>&1 && which xvfb-run >/dev/null 2>&1; then | |
| 25 | + say "Assuming dependencies are already installed. Pass --install to force their installation" | |
| 26 | +else | |
| 27 | + if !which lsb_release >/dev/null 2>&1; then | |
| 28 | + complain "E: lsb_release not available! (Try installing the lsb-release package)" | |
| 29 | + exit 1 | |
| 30 | + fi | |
| 31 | + system=$(echo $(lsb_release -sic) | awk '{print(tolower($1) "-" tolower($2))}') | |
| 32 | + install_script="$(dirname $0)/install-dependencies/${system}.sh" | |
| 33 | + if test -f "$install_script"; then | |
| 34 | + . $install_script | |
| 35 | + else | |
| 36 | + # FIXME the Ruby stuff could be installed with Rubygems | |
| 37 | + # FIXME but there is not generic way to install the non-Ruby stuff | |
| 38 | + complain "E: $install_script not found, cannot install dependencies." | |
| 39 | + exit 1 | |
| 40 | + fi | |
| 41 | +fi | |
| 42 | + | |
| 43 | +# setup solr | |
| 44 | +run 'rake solr:download || true' | |
| 45 | +if ! test -f vendor/plugins/acts_as_solr_reloaded/solr/start.jar; then | |
| 46 | + complain "Failed to download solr!" | |
| 47 | + exit 1 | |
| 48 | +fi | |
| 49 | + | |
| 50 | +run cp config/solr.yml.dist config/solr.yml | |
| 51 | + | |
| 52 | +# create the database with sample data | |
| 53 | +run cp config/database.yml.sqlite3 config/database.yml | |
| 54 | +run rake db:schema:load | |
| 55 | +run rake db:data:minimal | |
| 56 | +run rake db:test:prepare | |
| 57 | + | |
| 58 | +# compile translations | |
| 59 | +run rake noosfero:translations:compile | |
| 60 | + | |
| 61 | +# create needed directory | |
| 62 | +mkdir -p tmp/pids | |
| 63 | + | |
| 64 | +# use default gitignore rules | |
| 65 | +ln -s gitignore.example .gitignore | |
| 66 | + | |
| 67 | +# you can now start the server | |
| 68 | +say "I: Congratulations, you are ready to run Noosfero." | |
| 69 | +say "I: To execute Noosfero in development mode, run \`/script/development\` and browse to http://localhost:3000" | |
| 70 | +say "I: To execute Noosfero tests, run \`rake\`." | ... | ... |
script/quick-start-debian
| ... | ... | @@ -1,47 +0,0 @@ |
| 1 | -#!/bin/sh | |
| 2 | - | |
| 3 | -say() { | |
| 4 | - msg="$@" | |
| 5 | - printf "\033[33;01m%s\033[m\n" "$msg" | |
| 6 | -} | |
| 7 | - | |
| 8 | -run() { | |
| 9 | - say "\$ $@" | |
| 10 | - echo "$@" | sh | |
| 11 | - status="$?" | |
| 12 | - if [ $status -ne 0 ]; then | |
| 13 | - say "E: The command \"$@\" failed with status code $status, we cannot proceed." | |
| 14 | - say "I: If you have no idea of what went wrong, please feel free to ask for help in the Noosfero community. Check the contact information in the project website (http://noosfero.org/)." | |
| 15 | - exit 1 | |
| 16 | - fi | |
| 17 | -} | |
| 18 | - | |
| 19 | -# needed to run noosfero | |
| 20 | -runtime_dependencies=$(sed -e '1,/^Depends:/d; /^Recommends:/,$ d; s/([^)]*)//g; s/,\s*/\n/g' debian/control | grep -v 'memcached\|debconf\|dbconfig-common\|postgresql\|misc:Depends\|adduser\|mail-transport-agent') | |
| 21 | -run sudo apt-get -y install $runtime_dependencies | |
| 22 | - | |
| 23 | -# needed for development | |
| 24 | -run sudo apt-get -y install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb libxml2-dev libxslt-dev | |
| 25 | -gem which bundler >/dev/null 2>&1 || run gem install bundler | |
| 26 | -run bundle install | |
| 27 | - | |
| 28 | -# download and start solr | |
| 29 | -rake solr:download | |
| 30 | -rake solr:start | |
| 31 | - | |
| 32 | -# create the database with sample data | |
| 33 | -run cp config/database.yml.sqlite3 config/database.yml | |
| 34 | -run rake db:schema:load | |
| 35 | -run rake db:data:minimal | |
| 36 | -run rake db:test:prepare | |
| 37 | - | |
| 38 | -# compile translations | |
| 39 | -run rake noosfero:translations:compile | |
| 40 | - | |
| 41 | -# create needed directory | |
| 42 | -mkdir -p tmp/pids | |
| 43 | - | |
| 44 | -# you can now start the server | |
| 45 | -say "I: Congratulations, you are ready to run Noosfero." | |
| 46 | -say "I: To execute Noosfero in development mode, run \`/script/development\` and browse to http://localhost:3000" | |
| 47 | -say "I: To execute Noosfero tests, run \`rake\`." |
vendor/plugins/acts_as_solr_reloaded/lib/tasks/solr.rake
| ... | ... | @@ -18,13 +18,14 @@ namespace :solr do |
| 18 | 18 | task :download do |
| 19 | 19 | abort 'Solr already downloaded.' if solr_downloaded? |
| 20 | 20 | |
| 21 | - Dir.chdir '/tmp' do | |
| 21 | + tmpdir = [ '/var/tmp', '/tmp' ].find { |d| File.exists?(d) } | |
| 22 | + Dir.chdir tmpdir do | |
| 22 | 23 | sh "wget -c #{SOLR_URL}" |
| 23 | 24 | |
| 24 | - sh "echo \"#{SOLR_MD5SUM} /tmp/#{SOLR_FILENAME}\" | md5sum -c -" do |ok, res| | |
| 25 | + sh "echo \"#{SOLR_MD5SUM} #{SOLR_FILENAME}\" | md5sum -c -" do |ok, res| | |
| 25 | 26 | abort "MD5SUM do not match" if !ok |
| 26 | 27 | |
| 27 | - sh "tar xzf apache-solr-#{SOLR_VERSION}.tgz" | |
| 28 | + sh "tar xzf #{SOLR_FILENAME}" | |
| 28 | 29 | cd "apache-solr-#{SOLR_VERSION}/example" |
| 29 | 30 | |
| 30 | 31 | cp_r ['../LICENSE.txt', '../NOTICE.txt', 'README.txt', 'etc', 'lib', 'start.jar', 'webapps', 'work'], "#{PLUGIN_ROOT}/solr", :verbose => true | ... | ... |