diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2018-04-01 09:51:51 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2018-04-01 09:51:51 +0200 |
commit | e4dec2bc26ef55c550c91c329f382bc6f087284b (patch) | |
tree | 64a40d40b528db7fba643000347713e6bf968aef | |
parent | dbff5212481f4c113b68d584fac57b6feea4fbbd (diff) | |
download | hmnoweb-e4dec2bc26ef55c550c91c329f382bc6f087284b.tar.gz hmnoweb-e4dec2bc26ef55c550c91c329f382bc6f087284b.tar.bz2 hmnoweb-e4dec2bc26ef55c550c91c329f382bc6f087284b.zip |
Fix bootstrapping vagrant environment.
- just start postgresql instead of restarting everything after install.
- update setup script to install required ruby version and deps if not
installed.
- seed database when running the dev:setup rake task.
-rw-r--r-- | lib/tasks/dev_setup.rake | 2 | ||||
-rwxr-xr-x | script/setup | 11 | ||||
-rw-r--r-- | vagrant/bootstrap.sh | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/tasks/dev_setup.rake b/lib/tasks/dev_setup.rake index 73e0b01..7042710 100644 --- a/lib/tasks/dev_setup.rake +++ b/lib/tasks/dev_setup.rake @@ -10,5 +10,5 @@ namespace :dev do end desc "Setup local environment for development." - task :setup => [ 'config_refinery', 'config_db', 'db:setup' ] + task :setup => [ 'config_refinery', 'config_db', 'db:setup', 'db:seed' ] end diff --git a/script/setup b/script/setup index 7823f40..9ddd50b 100755 --- a/script/setup +++ b/script/setup @@ -1,4 +1,13 @@ -#!/bin/bash +#!/usr/bin/env bash +ruby_status=$(rbenv version |& awk '{ printf $4 " " $5 " " $6 }'|sed -r 's/[ ]+$//') +echo \"${ruby_status}\" +if [[ "${ruby_status}" == "is not installed" ]] +then + rbenv install $(cat .ruby-version) + gem install bundler + bundle config build.sqlite3 --with-sqlite3-dir=/usr/local +fi + bundle install --without=production if [ $? ]; then diff --git a/vagrant/bootstrap.sh b/vagrant/bootstrap.sh index 22e8f3c..8b3fad2 100644 --- a/vagrant/bootstrap.sh +++ b/vagrant/bootstrap.sh @@ -7,4 +7,4 @@ echo 'eval "$(rbenv init -)"' >> /home/vagrant/.bash_profile chsh -s /usr/local/bin/bash vagrant service postgresql initdb -service -R +service postgresql start |