skill-assessment-app/start-dev.sh

29 lines
818 B
Bash
Raw Normal View History

2016-07-27 11:17:50 -05:00
#!/bin/bash
2016-07-26 13:50:35 -05:00
if [ -d '/usr/app' ]; then
if [ ! -f 'config/application.yml' ]; then
echo ''
echo -e "\E[1;31m###################################"
echo "Missing application.yml"
echo -e "\E[1;32m cp config/application.yml.sample config/application.yml"
tput sgr0
echo "edit and update proper values"
echo ''
else
2016-09-01 14:49:13 -05:00
if [ ! -f '/root/.container-setup' ]; then
bundle
npm install
bower install --allow-root
rails db:setup
rails db:migrate
rails db:fixtures:load
2016-09-01 14:49:13 -05:00
touch /root/.container-setup
fi
tmux new-session -d -s 'rails-dev' 'rails s -b 0.0.0.0'
tmux split-window -p 15 -v
2016-09-01 14:49:13 -05:00
tmux split-window -p 85 -v 'bundle exec guard start --wait-for-delay 1.5'
tmux attach -t rails-dev
fi
2016-07-26 13:50:35 -05:00
else
echo "Are you in docker container?"
fi