internetee-registry/bin/robot
2014-10-10 11:02:54 +03:00

47 lines
1 KiB
Bash
Executable file

#!/bin/bash
#
# Build and run everything for automatic tests
#
set -o pipefail
# cd to Rails root directory
cd "$(dirname "$0")"; cd ..
git pull origin master
git reset --hard
unset GIT_DIR GIT_WORK_TREE
# run rubocop
echo "RUBOCOP_RESULTS"
rubocop
echo "END_OF_RUBOCOP_RESULTS"
bundle install --deployment
echo "SECURITY_RESULTS"
bundle-audit update
bundle-audit
brakeman
echo "END_OF_SECURITY_RESULTS"
# cp config/secrets-example.yml config/secrets.yml
# create manually config/database.yml
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
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 15 --pretty=oneline | sed -r '/^.{40} Merge branch/d' | sed -r 's/^.{40}/Latests: /'
echo "END_OF_GIT_LAST_COMMITS"
# run tests
echo "TEST_RESULTS"
RAILS_ENV=test ROBOT=true bundle exec rake test
echo "END_OF_TEST_RESULTS"
# update code review
rubycritic app lib