-
Notifications
You must be signed in to change notification settings - Fork 54
/
prepare-ruby-dev.sh
executable file
·35 lines (26 loc) · 1.09 KB
/
prepare-ruby-dev.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Prepare and update the application environment for Ruby/Nodejs development
# asdf-vm installation with ruby and nodejs plugins
export ASDF_BRANCH=v0.14.0
echo '>>> checking asdf installation'
./prepare-asdf.sh
# check nodejs version as set in package.json: install if mismatch, and correct .tool-versions'
echo '>>> check nodejs version as set in package.json: install if mismatch, and correct .tool-versions'
./prepare-nodejs.sh
# ruby gems installation
./prepare-rubygems.sh
# node packages installation
./prepare-nodejspkg.sh
# prepare rails server
rm -f tmp/pids/server.pid
if [ "$( psql -h postgres -U postgres -XtAc "SELECT 1 FROM pg_database WHERE datname='chemotion_dev'" )" = '1' ]
then
echo "================================================"
echo "Database already exists, skipping Database setup"
echo "================================================"
else
echo "================================================"
echo "Database does not exist, running 'rake db:setup'"
echo "================================================"
bundle exec rake db:setup
fi