Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deployment pipeline: useful tools on Rails

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for ciihla ciihla
September 27, 2018

Deployment pipeline: useful tools on Rails

Codecov
https://codecov.io/gh/topmonks/

Dependabot
● Dependabot PRs include release notes & changelogs
● Automatic merge for security fixes
https://app.dependabot.com/accounts/topmonks/repos
https://github.com/topmonks/lafluence-app/pull/180
https://gist.github.com/ciihla/090ff47661229cfb410b0a1a2d64445a

Logentries
https://logentries.com
● Filter logs
● Request context
● High response time

Rollbar
gem 'rollbar'
require 'rollbar/rails'
Rollbar.configure do |config|
config.access_token =
config.use_async = true
config.use_sidekiq...
config.exception_level_filters['ActionController::RoutingError'] = 'ignore'
end

Newrelic
https://rpm.newrelic.com/accounts/902279/applications/5107330
gem 'newrelic_rpm'

Bullet
Detect easily N+1 queries
gem 'bullet'
config.after_initialize do
Bullet.enable = true
Bullet.alert = true
Bullet.add_footer = true
end

Better errors
gem 'better_errors'
gem 'binding_of_caller'
Console in web browser

Rubocop
Codestyle & formatting
ABC metrics
Method/Class/Line length
Unused variables
Complexity of code
gem 'rubocop'
create config/rubocop.yml
run in terminal: rubocop -a

Avatar for ciihla

ciihla

September 27, 2018
Tweet

Other Decks in Technology

Transcript

  1. Be aware of • Docker - Swarm (Swarmpit) • Codecov

    • Dependabot • Rollbar • Newrelic • Logentries • Bullet • Rubocop
  2. Docker on Rails Dockerfile • WORKDIR /tmp • COPY Gemfile*

    /tmp/ • RUN bundle install --system --jobs 4 --retry 4 --without=development test • docker pull topmonkscom/lafluence-app:latest-$TRAVIS_BRANCH • docker build --cache-from topmonkscom/lafluence-app:latest-$TRAVIS_BRANCH -t lafluence-app -f docker/app/Dockerfile . • AssetsPipeline
  3. https://codecov.io/gh/topmonks/ • Track history • See commits • Include coverage

    badges group :test do gem 'codecov', require: false end require 'simplecov' SimpleCov.start require 'codecov' SimpleCov.formatter = SimpleCov::Formatter::Codecov Codecov
  4. • Dependabot PRs include release notes & changelogs • Automatic

    merge for security fixes https://app.dependabot.com/accounts/topmonks/repos https://github.com/topmonks/lafluence-app/pull/180 https://gist.github.com/ciihla/090ff47661229cfb410b0a1a2d64445a Dependabot
  5. Rollbar gem 'rollbar' require 'rollbar/rails' Rollbar.configure do |config| config.access_token =

    config.use_async = true config.use_sidekiq… config.exception_level_filters['ActionController::RoutingError'] = 'ignore' end • Multiple environments • User & Browser info • Request payload & cookies & extra data • Telemetry (JS errors) • Blacklist IPs https://rollbar.com/lafluence/Lafluence/items/
  6. Newrelic • All Transactions (Slowest, Highest throughput…) • Databases •

    External services • Memory usage • Errors analytic • And more... https://rpm.newrelic.com/accounts/902279/applications/5107330 gem 'newrelic_rpm'
  7. Bullet Detect easily N+1 queries gem 'bullet' config.after_initialize do Bullet.enable

    = true Bullet.alert = true Bullet.add_footer = true end
  8. Better errors gem 'better_errors' gem 'binding_of_caller' • Console in web

    browser • See all frames • Get access to whole context • Only in Development!
  9. Rubocop • Codestyle & formatting • ABC metrics • Method/Class/Line

    length • Unused variables • Complexity of code gem 'rubocop' create config/rubocop.yml run in terminal: rubocop -a