Travis CI File - Hives/acebook-business-logic GitHub Wiki
# environment vars
env:
global:
# Code climate test reporter api key
CC_TEST_REPORTER_ID=634c89ddb16bad65543236ca41d51dc282320eb5e4b88443b4cffece62a8c75b
# set language to ruby
language: ruby
# tell rvm to install and use 2.5.0 version of ruby
rvm:
- 2.5.0
cache:
- bundler: true
# before install - install latest bundler version
before_install: gem install bundler
# disable notifications
notifications:
-false
# before executing scripts run db:create and db:migrate
before_script:
- bundle exec rake db:create
- bundle exec rake db:migrate
# installs code climate coverage test reporter module and import command to .//cc-test-reporter
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
# give permissions to excute test reporter
- chmod +x ./cc-test-reporter
# run test reporter before build
- ./cc-test-reporter before-build
# Run the test suites
script:
- bundle exec rspec spec # rspec testing
# run test reporter after build when exit code is when travis ends with a test result
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
# deploy to provider could be aws, heroku etc etc
deploy:
# specify provider
provider: heroku
api_key:
# put your provider key in secure, this one is encrypted using travis CLI command
secure: "iewJbVCj78FpQjmLIlm092hEYjIvnu8xSA3mBf1qPR73H+hjtQAqDm5Pg37CTT+4q4DkjRMNUfivS/fNUYDZUqWRbJVxLBHRcYKhNxa/UesN0jl4gQdtvZzh0g/a/Xey8MFGHIYMIoGFYwCDEk4iirN8QAFvR1OcVMdxbQDJEyT9bgRmDx94SUWVLxIrIMCU5Un1Xp7jIjI+A5b5T4FQeki8z/FVEgnxlVyEx5oxn95oGKrTwMMs72Ecjs7v68OTO3DUbRDeSCgGJv+idTDMPLywIFjbc27hDuOU0Ki5tF5s4cZtkKi7UNp/z05QI8J8ezg1vKWy55Tn/SOo/fKtHb+dFHEYEwGbwVUSGEYkBaFK/ScDjFMMq7JISF+vccWXjmsa5o/3Cu96p3lMA4QJDkSF1Beo7mrAdBp2ymhPQ9NiJd26HeqfGfcwvuMJC/5wH9Igiwc+OJJAA428U9W+Zpmvnwn0e+iGedKkaX/Zwt/Y0Q+hHWtWsdlyZPzsBqGXDo288UuYo71wS+DSWlMZ4+/zaJNGsau1Hi9cUofuXseXrZ0epPPR0Z10h3LYgI8VN+a5hOxn1lATFmXatllhPQ7qp5COdHISN6GFzUkDFBjd1whY81HL/FWJIceJrsjdautKbZCtSJH8Q1VFDDqNL0Otln2DXjaMb+cNbQ3lSpw="
# same as heroku run rails db:migrate, to ensure latest db schema up to date
run: "rails db:migrate"