Environment sanity checks in script/server #3824
This commit is contained in:
parent
c95dd68545
commit
3763a87744
1 changed files with 27 additions and 0 deletions
|
|
@ -61,6 +61,33 @@ then
|
|||
fatal "config/diaspora.yml is missing! Copy over config/diaspora.yml.example to config/diaspora.yml and edit it properly!"
|
||||
fi
|
||||
|
||||
# Check if detached head state
|
||||
if git status | grep 'Changes not staged for commit' > /dev/null ;
|
||||
then
|
||||
warning "Your changes are not staged for commit. Kindly stash or commit them"
|
||||
fi
|
||||
|
||||
# Check if RVM available
|
||||
if rvm -v | grep 'No command '"'"'rvm'"'"' found' > /dev/null ;
|
||||
then
|
||||
warning "RVM is not installed on the system. Please install it"
|
||||
fi
|
||||
|
||||
# Check if bundle is complete
|
||||
if ! bundle check > /dev/null
|
||||
then
|
||||
fatal "Your bundle is not up to date, run the command \"bundle install\""
|
||||
fi
|
||||
|
||||
# Check if database is migrated and correct gemset
|
||||
if rake db:migrate:status | grep 'down' > /dev/null ;
|
||||
then
|
||||
warning "Your database is not migrated, run the command \"rake db:migrate\""
|
||||
elif rake db:migrate:status | grep 'rake aborted' > /dev/null ;
|
||||
then
|
||||
warning "The gemset is not correct"
|
||||
fi
|
||||
|
||||
# Setup environment
|
||||
if [ -z "$RAILS_ENV" ]
|
||||
then
|
||||
|
|
|
|||
Loading…
Reference in a new issue