Commit 39d29854bb72e95d3376a8b323bce0b228cf107a

Authored by Antonio Terceiro
1 parent be0349f9

quick-start: don't wipe the development DB every time

Showing 1 changed file with 9 additions and 6 deletions   Show diff stats
script/quick-start
@@ -71,21 +71,24 @@ else @@ -71,21 +71,24 @@ else
71 fi 71 fi
72 fi 72 fi
73 73
74 -# create the database with sample data  
75 if test -e config/database.yml && test "$force_install" = 'false'; then 74 if test -e config/database.yml && test "$force_install" = 'false'; then
76 say 'Not updating existent database.yml.' 75 say 'Not updating existent database.yml.'
77 - say 'If you wish to automatic reconfigure your database connection, you can delete config/database.yml and run this script again.' 76 + say 'If you wish to automatic reconfigure your database connection and'
  77 + say 'recreate the database, you can delete config/database.yml and run'
  78 + say 'this script again.'
78 else 79 else
  80 + # create the database with sample data
79 say 'Configuring Noosfero to use PostgreSQL, with your user.' 81 say 'Configuring Noosfero to use PostgreSQL, with your user.'
80 run cp config/database.yml.pgsql config/database.yml 82 run cp config/database.yml.pgsql config/database.yml
81 sed -ri "s/username: noosfero/username: $USER/" config/database.yml 83 sed -ri "s/username: noosfero/username: $USER/" config/database.yml
82 sudo su - postgres -c "createuser $USER --no-superuser --createdb --no-createrole" 84 sudo su - postgres -c "createuser $USER --no-superuser --createdb --no-createrole"
83 sudo su - postgres -c "createdb noosfero_development -O $USER" 85 sudo su - postgres -c "createdb noosfero_development -O $USER"
  86 +
  87 + run rake db:schema:load
  88 + run rake db:data:minimal
  89 + run rake db:test:prepare
  90 + rails runner 'Environment.default.enable("skip_new_user_email_confirmation")'
84 fi 91 fi
85 -run rake db:schema:load  
86 -run rake db:data:minimal  
87 -run rake db:test:prepare  
88 -rails runner 'Environment.default.enable("skip_new_user_email_confirmation")'  
89 92
90 # FIXME compile translations depends on ruby-gettext-rails, please see debian/control 93 # FIXME compile translations depends on ruby-gettext-rails, please see debian/control
91 # run rake noosfero:translations:compile 94 # run rake noosfero:translations:compile