From ac3924da64bb2c71f8611919e5f43b85261da600 Mon Sep 17 00:00:00 2001 From: Jason Draper Date: Fri, 24 Jul 2015 10:40:26 -0400 Subject: [PATCH] Replace TravisCI with CircleCI This is the result of two discussions on our research board. The first was to replace Travis with CircleCI: https://trello.com/c/Se4mELMh/199-hosted-ci-for-continuous-deployment A few reasons we've enjoyed using Circle: * Faster builds due to parallel builds * Built in bundle caching * Easy deployment * Really easy setup * The ability to ssh into the CI server during a test run. This has been great when debugging a test failure. It's not something you use a lot but it is so great when you need it. * A free plan for private repos that supports small MVPS This also adds automatic deployment to staging when the build passes. This is the result of this discussion: https://trello.com/c/Se4mELMh/199-hosted-ci-for-continuous-deployment A few reasons for those who don't have access to the trello card: * Part of the CI now is whether or not you can actually deploy successfully. If you merge to master, it will automatically try and deploy to staging. If that fails, your build will actually fail. This should be treated with the same urgency that any other failing build on master would be treated. * Staging is always up to date. This makes it really nice for verifying stories for clients. * Automate more things! --- README.md | 4 ++-- lib/suspenders/app_builder.rb | 4 ++-- lib/suspenders/generators/app_generator.rb | 2 +- templates/circle.yml.erb | 8 ++++++++ templates/travis.yml.erb | 21 --------------------- 5 files changed, 13 insertions(+), 26 deletions(-) create mode 100644 templates/circle.yml.erb delete mode 100644 templates/travis.yml.erb diff --git a/README.md b/README.md index 03fc5c576..f30a7581c 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Suspenders also comes with: * [t() and l() in specs without prefixing with I18n][i18n] * An automatically-created `SECRET_KEY_BASE` environment variable in all environments -* Configuration for [Travis][travis] Continuous Integration (tests) +* Configuration for [CircleCI][circle] Continuous Integration (tests) * Configuration for [Hound][hound] Continuous Integration (style) * The analytics adapter [Segment][segment] (and therefore config for Google Analytics, Intercom, Facebook Ads, Twitter Ads, etc.) @@ -107,7 +107,7 @@ Suspenders also comes with: [pool]: https://devcenter.heroku.com/articles/concurrency-and-database-connections [binstub]: https://github.com/thoughtbot/suspenders/pull/282 [i18n]: https://github.com/thoughtbot/suspenders/pull/304 -[travis]: http://docs.travis-ci.com/user/travis-pro/ +[circle]: https://circleci.com/docs [hound]: https://houndci.com [segment]: https://segment.com diff --git a/lib/suspenders/app_builder.rb b/lib/suspenders/app_builder.rb index 7176ec8e7..a4dc17894 100644 --- a/lib/suspenders/app_builder.rb +++ b/lib/suspenders/app_builder.rb @@ -209,8 +209,8 @@ def configure_rspec copy_file "spec_helper.rb", "spec/spec_helper.rb" end - def configure_travis - template 'travis.yml.erb', '.travis.yml' + def configure_ci + template "circle.yml.erb", "circle.yml" end def configure_i18n_for_test_environment diff --git a/lib/suspenders/generators/app_generator.rb b/lib/suspenders/generators/app_generator.rb index e33d51be9..6bb38bebc 100644 --- a/lib/suspenders/generators/app_generator.rb +++ b/lib/suspenders/generators/app_generator.rb @@ -95,7 +95,7 @@ def setup_test_environment build :configure_background_jobs_for_rspec build :enable_database_cleaner build :configure_spec_support_features - build :configure_travis + build :configure_ci build :configure_i18n_for_test_environment build :configure_i18n_tasks build :configure_action_mailer_in_specs diff --git a/templates/circle.yml.erb b/templates/circle.yml.erb new file mode 100644 index 000000000..92bc761bc --- /dev/null +++ b/templates/circle.yml.erb @@ -0,0 +1,8 @@ +test: + override: + - bundle exec rake +deployment: + staging: + branch: master + commands: + - bin/deploy staging diff --git a/templates/travis.yml.erb b/templates/travis.yml.erb deleted file mode 100644 index 657de53c6..000000000 --- a/templates/travis.yml.erb +++ /dev/null @@ -1,21 +0,0 @@ -before_install: - - "echo '--colour' > ~/.rspec" - - "echo 'gem: --no-document' > ~/.gemrc" - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start -install: - - bin/setup -branches: - only: - - master -cache: - - bundler -language: - - ruby -notifications: - email: false -rvm: - - <%= Suspenders::RUBY_VERSION %> -addons: - postgresql: "9.3" -sudo: false