#!/bin/sh say() { msg="$@" printf "\033[33;01m%s\033[m\n" "$msg" } run() { say "\$ $@" echo "$@" | sh status="$?" if [ $status -ne 0 ]; then say "E: The command \"$@\" failed with status code $status, we cannot proceed." 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/)." exit 1 fi } # needed to run noosfero 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') run sudo apt-get -y install $runtime_dependencies # needed for development run sudo apt-get -y install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb run gem install bundler run bundle install # create the database with sample data run cp config/database.yml.sqlite3 config/database.yml run rake db:schema:load run rake db:data:minimal run rake db:test:prepare # compile translations run rake noosfero:translations:compile # start server say "I: Congratulations, you are ready to run Noosfero." say "I: To execute Noosfero server, run \`/script/server\` and browse to http://localhost:3000" say "I: To execute Noosfero tests, run \`rake\`."