From e81ea9b25ff438370c413112d1227396ffdec9e3 Mon Sep 17 00:00:00 2001 From: yafeilee Date: Sat, 19 May 2018 17:30:25 +0800 Subject: [PATCH] trying fix travis ci --- .travis.yml | 17 ++++++++++++----- lib/tasks/travis.rake | 11 ----------- 2 files changed, 12 insertions(+), 16 deletions(-) delete mode 100644 lib/tasks/travis.rake diff --git a/.travis.yml b/.travis.yml index 45382b9..3892672 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ # http://about.travis-ci.org/docs/user/build-configuration/ +env: + global: + - CC_TEST_REPORTER_ID=787a2f89b15c637323c7340d65ec17e898ac44480706b4b4122ea040c2a88f1d language: ruby -#bundler_args: '--without production' - -script: CODECLIMATE_REPO_TOKEN=7d6b988f58234bf1560305412d10d9530902beebdbe2fb938b6a934f1d352578 bundle exec rake - before_install: - "cat /etc/timezone" - "grep -i processor /proc/cpuinfo | wc -l" @@ -13,12 +12,20 @@ before_install: - "bundle -v" before_script: + - "curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter" + - "chmod +x ./cc-test-reporter" + - "./cc-test-reporter before-build" - "cp -f config/database.yml.example config/database.yml" - "cp -f config/application.yml.example config/application.yml" - "bundle exec rake db:drop db:create db:schema:load --trace 2>&1" +script: bundle exec rspec + +after_script: + - "./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT" + services: - - postgresql + - postgresql rvm: - 2.3.1 diff --git a/lib/tasks/travis.rake b/lib/tasks/travis.rake deleted file mode 100644 index d892d72..0000000 --- a/lib/tasks/travis.rake +++ /dev/null @@ -1,11 +0,0 @@ -namespace :travis do - def verbose_system(*args) - puts(args.join(' ')) - system(*args) - end - task :before_script do - verbose_system("cp -f config/mongoid.yml.example config/mongoid.yml") - verbose_system("cp -f config/application.yml.example config/application.yml") - end - -end