Commit 161785bd1cdd92832f9aaa1f6bb34b62abe434da
Exists in
master
and in
23 other branches
Merge branch 'master' of https://gitlab.com/noosfero/noosfero
Showing
2 changed files
with
9 additions
and
13 deletions
Show diff stats
script/install-dependencies/debian-squeeze.sh
| 1 | 1 | # needed to run noosfero |
| 2 | 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 update | |
| 3 | 4 | run sudo apt-get -y install $runtime_dependencies |
| 4 | 5 | sudo apt-get -y install iceweasel || sudo apt-get -y install firefox |
| 5 | 6 | |
| 6 | 7 | # needed for development |
| 7 | -run sudo apt-get -y install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb libxml2-dev libxslt-dev postgresql | |
| 8 | +run sudo apt-get -y install libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb libxml2-dev libxslt-dev postgresql openjdk-6-jre | |
| 8 | 9 | gem which bundler >/dev/null 2>&1 || gem_install bundler |
| 9 | 10 | setup_rubygems_path |
| 10 | 11 | run bundle install | ... | ... |
script/quick-start
| ... | ... | @@ -30,6 +30,10 @@ gem_install() { |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | setup_rubygems_path() { |
| 33 | + local dir="$(ruby -rubygems -e 'puts Gem.dir')/bin" | |
| 34 | + if [ -d "$dir" ]; then | |
| 35 | + export PATH="$dir:$PATH" | |
| 36 | + fi | |
| 33 | 37 | local dir="$(ruby -rubygems -e 'puts Gem.user_dir')/bin" |
| 34 | 38 | if [ -d "$dir" ]; then |
| 35 | 39 | export PATH="$dir:$PATH" |
| ... | ... | @@ -67,25 +71,16 @@ else |
| 67 | 71 | fi |
| 68 | 72 | |
| 69 | 73 | # create the database with sample data |
| 70 | -if test -e config/database.yml; then | |
| 74 | +if test -e config/database.yml && test "$force_install" = 'false'; then | |
| 71 | 75 | say 'Not updating existent database.yml.' |
| 72 | 76 | say 'If you wish to automatic reconfigure your database connection, you can delete config/database.yml and run this script again.' |
| 73 | 77 | else |
| 74 | 78 | say 'Configuring Noosfero to use PostgreSQL, with your user.' |
| 75 | 79 | run cp config/database.yml.pgsql config/database.yml |
| 76 | 80 | sed -ri "s/username: noosfero/username: $USER/" config/database.yml |
| 77 | - sudo -u postgres createuser $USER --no-superuser --createdb --no-createrole | |
| 78 | -fi | |
| 79 | -DB_USER="$( | |
| 80 | - grep username: config/database.yml | head -n1 | sed -r 's/.*:\s*([^ ]+).*/\1/' | |
| 81 | -)" | |
| 82 | -if test -n "$DB_USER"; then | |
| 83 | - say "DB user: $DB_USER" | |
| 84 | -else | |
| 85 | - say 'It looks like your database.yml have no user defined' | |
| 86 | - DB_USER=$USER | |
| 81 | + sudo su - postgres -c "createuser $USER --no-superuser --createdb --no-createrole" | |
| 82 | + sudo su - postgres -c "createdb noosfero_development -O $USER" | |
| 87 | 83 | fi |
| 88 | -sudo -u postgres createdb noosfero_development -O $DB_USER | |
| 89 | 84 | run rake db:schema:load |
| 90 | 85 | run rake db:data:minimal |
| 91 | 86 | run rake db:test:prepare | ... | ... |