Skip to content
Extraits de code Groupes Projets
Valider 2fa4c07a rédigé par Jan Berdajs's avatar Jan Berdajs
Parcourir les fichiers

fix sanity checks in script/server, remove migration check because it is too...

fix sanity checks in script/server, remove migration check because it is too slow and Rails 4 checks it on first request anyway
parent 3763a877
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -61,16 +61,29 @@ then ...@@ -61,16 +61,29 @@ then
fatal "config/diaspora.yml is missing! Copy over config/diaspora.yml.example to config/diaspora.yml and edit it properly!" fatal "config/diaspora.yml is missing! Copy over config/diaspora.yml.example to config/diaspora.yml and edit it properly!"
fi fi
# Check if detached head state command -v git > /dev/null 2>&1
if git status | grep 'Changes not staged for commit' > /dev/null ; if [ $? -eq 0 ]; then
then # Check if git merge is in progress
warning "Your changes are not staged for commit. Kindly stash or commit them" if [ -f .git/MERGE_MODE ]; then
fatal "A git merge is in progress!"
fi
# Check if detached head state
git_branch_name="$(git symbolic-ref HEAD 2>/dev/null)"
if [ -z "$git_branch_name" ];
then
warning "You are in detached HEAD state!"
fi
fi fi
# Check if RVM available # Do RVM checks if RVM is being used
if rvm -v | grep 'No command '"'"'rvm'"'"' found' > /dev/null ; command -v rvm > /dev/null 2>&1
then if [ $? -eq 0 ]; then
warning "RVM is not installed on the system. Please install it" rvm_gemset="$(rvm current | cut -d"@" -f2)"
project_gemset="$(cat .ruby-gemset | tr -d " \t\n\r")"
if [ "$rvm_gemset" != "$project_gemset" ]; then
warning "Project gemset is $project_gemset but you are using $rvm_gemset"
fi
fi fi
# Check if bundle is complete # Check if bundle is complete
...@@ -79,15 +92,6 @@ then ...@@ -79,15 +92,6 @@ then
fatal "Your bundle is not up to date, run the command \"bundle install\"" fatal "Your bundle is not up to date, run the command \"bundle install\""
fi 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 # Setup environment
if [ -z "$RAILS_ENV" ] if [ -z "$RAILS_ENV" ]
then then
...@@ -133,8 +137,8 @@ if [ -w "public" -a ! -e "public/source.tar.gz" ] ...@@ -133,8 +137,8 @@ if [ -w "public" -a ! -e "public/source.tar.gz" ]
then then
if command -v git > /dev/null 2>&1 && git rev-parse --is-inside-work-tree > /dev/null 2>&1 if command -v git > /dev/null 2>&1 && git rev-parse --is-inside-work-tree > /dev/null 2>&1
then then
branch=$(git branch | awk '/^[*]/ {print $2}') commit_sha=$(git rev-parse HEAD)
tar czf public/source.tar.gz $(git ls-tree -r $branch | awk '{print $4}') tar czf public/source.tar.gz $(git ls-tree -r $commit_sha | awk '{print $4}')
else else
fatal "Can't generate public/source.tar.gz for you. fatal "Can't generate public/source.tar.gz for you.
Please tar up a copy of your Diaspora installation and place it there." Please tar up a copy of your Diaspora installation and place it there."
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter