Robot: cleaned up robot script

This commit is contained in:
Priit Tamboom 2014-10-10 13:39:55 +03:00
parent bb50ec2a9f
commit a88dd14b03

View file

@ -1,6 +1,6 @@
#!/bin/bash
#
# Build and run everything for automatic tests
# Update repo
#
# default locations
@ -8,44 +8,11 @@ export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# fail later
set -o pipefail
# cd to Rails root directory
cd "$(dirname "$0")"; cd ..
# cp config/secrets-example.yml config/secrets.yml
# create manually config/database.yml
git pull origin master &> /dev/null
git reset --hard &> /dev/null
unset GIT_DIR GIT_WORK_TREE
bundle install
RAILS_ENV=test bundle exec rake db:drop
RAILS_ENV=test bundle exec rake db:create
RAILS_ENV=test bundle exec rake db:schema:load &> /dev/null
RAILS_ENV=test bundle exec rake db:seed
RAILS_ENV=test bundle exec rake assets:precompile
echo "GIT_LAST_COMMITS"
git log origin/master -n 10 --pretty=oneline | sed -r '/^.{40} Merge branch/d' | sed -r 's/^.{40}/Latest: /'
echo "END_OF_GIT_LAST_COMMITS"
echo "RUBOCOP_RESULTS"
bundle exec rubocop
echo "END_OF_RUBOCOP_RESULTS"
echo "TEST_RESULTS"
ROBOT=true bundle exec rake test
echo "END_OF_TEST_RESULTS"
echo "SECURITY_RESULTS"
bundle exec bundle-audit update
bundle exec bundle-audit
bundle exec brakeman
echo "END_OF_SECURITY_RESULTS"
# update code review
bundle exec rubycritic app lib
bin/robot-audit