SlideShare a Scribd company logo
Toolbox of a Ruby team
Team Ro 
@Artto
The basics of development in a team 
● A code repository 
● Consistent development environment 
● Code quality and code style consistency 
● CI and deployment procedure 
● Error tracking 
● Communication
Issue tracking? 
● Jira 
● Pivotal Tracker 
● Trello
Development environment 
● No need for a virtual machine! 
● rvm 
● .env 
● Database - Postgres App 
● Pow
is a command-line tool which 
allows you to easily install, manage, and work 
with multiple ruby environments from 
interpreters to sets of gems.
Examples 
>rvm use 2.1.1 
>rvm gemset create rails4 
>rvm use 2.1.1@rails4 
>gem install … 
>bundle install …
.ruby-version, .ruby-gemset 
Specify the gemset name and ruby version by 
including these two files in the root folder of the 
Rails project.
.env 
Shim to load environment variables from .env 
into ENV in development. 
gem ‘dotenv-rails’
.env example 
FACEBOOK_API_KEY=f4c3b00kt3st 
GA_CODE=UA-546094580-1 
MAIL_HOSTNAME=example.com
Postgres.app 
The easiest way to get started with PostgreSQL on the Mac 
rake db:create db:migrate
Pow: Zero-configuration Rack server for Mac OS X 
$ cd ~/.pow 
$ ln -s /path/to/myapp 
Then just go to http://myapp.dev/ and POW, it’s 
running (or maybe you forgot to run bundle install)!
.powrc 
if [ -f "$rvm_path/scripts/rvm" ]; 
then 
source "$rvm_path/scripts/rvm" 
rvm use . 
fi
Development environment setup steps: 
>git clone [git repo] 
>cd newapp 
ruby-2.1.2 - #gemset created /Users/user/.rvm/gems/ruby-2.1.2@newapp 
ruby-2.1.2 - #generating newapp wrappers - please wait 
>bundle install 
… 
>rake db:create db:migrate 
… 
>cd ~/.pow 
>ln -s /path/to/newapp 
http://newap.dev/
Code style and consistency 
The Ruby and RoR community is strict when it 
comes to coding style and conventions! 
This is really helpful for teams working on 
projects, onboarding of new developers is easy.
Sublime Text settings 
For basic stuff, there’s these Sublime settings: 
● Auto-delete trailing whitespaces 
● Add newlines at the end of files 
This will save you a bunch of unnecessary headaches.
Mandatory Sublime Settings 
// Set to true to removing trailing whitespace on save 
"trim_trailing_white_space_on_save": true, 
// Set to true to ensure the last line of the file ends in a newline 
// character when saving 
"ensure_newline_at_eof_on_save": true,
Code quality 
● Code review! 
● Naforo - not currently maintained :( 
● Github pull requests - good enough
Pull Requests 
When merging feature branches into master, 
do it via pull requests - this provides good 
basics for code review.
Code repository 
● Git 
● When pulling from origin, do it using the -- 
rebase option, to avoid unnecessary merge 
commits 
● Don’t change merge commit messages! 
● Is it sometimes acceptable to do a force 
push, to make the repo cleaner?
CI and Deployment 
● Heroku - making it super simple, but has 
downsides 
● Mina and Capistrano 
● Circle CI
Easy to configure, runs tests, deploys code. 
Hooks up to github, so it all runs every time you 
push something into the repo. Deployment 
procedure descirbed in the circle.yml file.
Example circle.yml 
machine: 
services: 
- postgresql 
deployment: 
staging: 
branch: master 
commands: 
- '[[ ! -s "$(git rev-parse --git-dir)/shallow" ]] || git fetch --unshallow' 
- git push --force git@heroku.com:staging-theapp.git $CIRCLE_SHA1:master: 
timeout: 900 
- heroku run rake db:migrate --app staging-theapp 
- curl https://api.rollbar.com/api/1/deploy/ -F access_token=$RB_AT -F environment=staging -F 
revision=$(git log -n 1 --pretty=format:"%H") -F local_username=CircleCI
Example circle.yml 
production: 
branch: production 
commands: 
- '[[ ! -s "$(git rev-parse --git-dir)/shallow" ]] || git fetch --unshallow' 
- git push --force git@heroku.com:production-theapp.git $CIRCLE_SHA1:master: 
timeout: 900 
- heroku run rake db:migrate --app production-theapp 
- git config user.name "DLabs CircleCi" 
- git config user.email "ci@dlabs.si" 
- git tag -a $(date "+%Y%m%d%H%M")-production $CIRCLE_SHA1 -m "$(date "+%Y%m%d%H%M") deployed to 
production" 
- '[[ ! -s "$(git rev-parse --git-dir)/shallow" ]] || git fetch --unshallow' 
- git push git@github.com:dlabs/theapp.git --tags 
- curl https://api.rollbar.com/api/1/deploy/ -F access_token=$RB_ATP -F environment=production -F 
revision=$(git log -n 1 --pretty=format:"%H") -F local_username=CircleCI
Wonders of Heroku 
Super easy to deploy and scale your app. 
Just push into your Heroku app’s repo and it will set it up 
automatically. Use $$$liders to scale up your app! 
No static IP 
DNS is tricky (many DNS providers don’t offer CNAME 
domain records for root domains), if you need a static IP, 
you’ll need to set up your own proxy or use Proximo($$$).
$ bundle exec cap staging deploy 
$ bundle exec cap production deploy
Example Capistrano Task 
server 'example.com', roles: [:web, :app] 
server 'example.org', roles: [:db, :workers] 
desc "Report Uptimes" 
task :uptime do 
on roles(:all) do |host| 
execute :any_command, "with args", :here, "and here" 
info "Host #{host} (#{host.roles.to_a.join(', ')}):t#{capture(:uptime)}" 
end 
end
Really fast deployer and server automation tool 
“Mina works really fast because it’s a deploy Bash script 
generator. It generates an entire procedure as a Bash 
script and runs it remotely in the server”
Mina example deploy 
$ mina deploy --verbose 
-----> Creating the build path 
$ mkdir tmp/build-128293482394 
-----> Cloning the Git repository 
$ git clone https://github.com/nadarei/flipstack.git . -n --recursive 
Cloning... done. 
-----> Installing gem dependencies using Bundler 
$ bundle install --without development:test 
Using i18n (0.6.0) 
Using multi_json (1.0.4) 
... 
Your bundle is complete! It was installed to ./vendor/bundle 
-----> Moving to releases/4 
$ mv "./tmp/build-128293482394" "releases/4" 
-----> Symlinking to current 
$ ln -nfs releases/4 current 
-----> Launching 
$ cd releases/4 
$ sudo service nginx restart 
-----> Done. Deployed v4
Error Tracking 
Watch those overage fees!!! 
Also includes some handy performance metrics
WebHooks: 
● github pushes 
● CI - tests and deployment 
● code review notifications 
● error tracking 
Animated GIFs!
Toolbox of a Ruby Team
HipChat - Github
HipChat - Circle CI
HipChat - Error Tracking 
:(
HipChat - Cat Facts
?
Links 
http://rvm.io/ 
http://postgresapp.com/ 
http://pow.cx/ 
http://www.sublimetext.com/ 
https://circleci.com/ 
http://nadarei.co/mina/ 
http://capistranorb.com/ 
https://www.hipchat.com/ 
https://www.heroku.com/ 
https://rollbar.com 
https://appsignal.com/

More Related Content

What's hot (20)

PDF
Into The Box 2018 Going live with commandbox and docker
Ortus Solutions, Corp
 
PPTX
Capistrano 3 Deployment
Creston Jamison
 
PDF
Using Capifony for Symfony apps deployment (updated)
Žilvinas Kuusas
 
PPT
Learn basic ansible using docker
Larry Cai
 
PDF
A quick intro to Ansible
Dan Vaida
 
PPTX
Deployment with Fabric
andymccurdy
 
PPT
Python Deployment with Fabric
andymccurdy
 
KEY
Using rbenv in Production
Nic Benders
 
PDF
Provisioning iOS CI Server with Ansible
Shashikant Jagtap
 
PDF
Ansible, best practices
Bas Meijer
 
PDF
Background processing with Resque
Nicolas Blanco
 
PPTX
JavaScript Task Runners - Gulp & Grunt
Lohith Goudagere Nagaraj
 
PDF
Introduction to ansible galaxy
Ivan Serdyuk
 
PDF
DevOps tools for everyone - Vagrant, Puppet and Webmin
postrational
 
PDF
以 Laravel 經驗開發 Hyperf 應用
Shengyou Fan
 
PDF
Puppet in the Pipeline
Puppet
 
PDF
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
 
PDF
PDXPortland - Dockerize Django
Hannes Hapke
 
KEY
GPerf Using Jesque
ctoestreich
 
PDF
Infrastructure = Code
Georg Sorst
 
Into The Box 2018 Going live with commandbox and docker
Ortus Solutions, Corp
 
Capistrano 3 Deployment
Creston Jamison
 
Using Capifony for Symfony apps deployment (updated)
Žilvinas Kuusas
 
Learn basic ansible using docker
Larry Cai
 
A quick intro to Ansible
Dan Vaida
 
Deployment with Fabric
andymccurdy
 
Python Deployment with Fabric
andymccurdy
 
Using rbenv in Production
Nic Benders
 
Provisioning iOS CI Server with Ansible
Shashikant Jagtap
 
Ansible, best practices
Bas Meijer
 
Background processing with Resque
Nicolas Blanco
 
JavaScript Task Runners - Gulp & Grunt
Lohith Goudagere Nagaraj
 
Introduction to ansible galaxy
Ivan Serdyuk
 
DevOps tools for everyone - Vagrant, Puppet and Webmin
postrational
 
以 Laravel 經驗開發 Hyperf 應用
Shengyou Fan
 
Puppet in the Pipeline
Puppet
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
 
PDXPortland - Dockerize Django
Hannes Hapke
 
GPerf Using Jesque
ctoestreich
 
Infrastructure = Code
Georg Sorst
 

Viewers also liked (10)

PDF
Getting started
Lisa McCarthy
 
PDF
Testiranje s capybaro
Arto Artnik
 
PDF
PCI DSS v 2.0 - Don't Fall In. Short & high level presentation for the Ecomme...
nostradelboy
 
PPTX
'Video for Business': Webvideos seminar at The Business Show 2013 - London
Web Videos
 
PDF
Game Of Thrones - Fenomenologia dei Media
Francesca Tessaroli
 
PDF
χριστουγεννα στο σπιτι_του_αη-βασιλη_αη_οκ____________ (1)
Ευαγγελία Τριανταφύλλου
 
PPTX
119724447 παρουσιαση-για-τους-σεισμους
Ευαγγελία Τριανταφύλλου
 
PPT
元智大學 原味市集.希望農場(報告)
nehemiah0000
 
DOCX
Libro de ejercicio word 2007
luchilita
 
PPTX
Els cavalls
ilenia13
 
Getting started
Lisa McCarthy
 
Testiranje s capybaro
Arto Artnik
 
PCI DSS v 2.0 - Don't Fall In. Short & high level presentation for the Ecomme...
nostradelboy
 
'Video for Business': Webvideos seminar at The Business Show 2013 - London
Web Videos
 
Game Of Thrones - Fenomenologia dei Media
Francesca Tessaroli
 
χριστουγεννα στο σπιτι_του_αη-βασιλη_αη_οκ____________ (1)
Ευαγγελία Τριανταφύλλου
 
119724447 παρουσιαση-για-τους-σεισμους
Ευαγγελία Τριανταφύλλου
 
元智大學 原味市集.希望農場(報告)
nehemiah0000
 
Libro de ejercicio word 2007
luchilita
 
Els cavalls
ilenia13
 
Ad

Similar to Toolbox of a Ruby Team (20)

PDF
Hosting Ruby Web Apps
Michael Reinsch
 
PDF
Basic Rails Training
Arthit Hongchintakul
 
PPT
Rails Rookies Bootcamp - Blogger
Nathanial McConnell
 
KEY
Rails tools
Reuven Lerner
 
PPT
Capistrano Deployment By Nyros Developer
Nyros Technologies
 
PPTX
2018 RubyHACK: put git to work - increase the quality of your rails project...
Rodrigo Urubatan
 
PDF
Rock Solid Deployment of Web Applications
Pablo Godel
 
PDF
Empowered productivity
Giedrius Rimkus
 
PPTX
2018 the conf put git to work - increase the quality of your rails project...
Rodrigo Urubatan
 
PDF
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 
PDF
Ruby on Rails Kickstart 101 & 102
Heng-Yi Wu
 
KEY
Ruby v cpp_preso
jessicard
 
KEY
Railsconf2011 deployment tips_for_slideshare
tomcopeland
 
ODP
DiUS Computing Lca Rails Final
Robert Postill
 
KEY
Ruby on Rails survival guide of an aged Java developer
gicappa
 
PPT
First app
Benjamin Taylor
 
PDF
Automated Releases to RubyGems.org using Travis-CI.org
Francis Luong
 
PPTX
DCRUG: Achieving Development-Production Parity
Geoff Harcourt
 
PDF
Developing Rails Apps in Technical Isolation
Jesus Jackson
 
KEY
An introduction to Rails 3
Blazing Cloud
 
Hosting Ruby Web Apps
Michael Reinsch
 
Basic Rails Training
Arthit Hongchintakul
 
Rails Rookies Bootcamp - Blogger
Nathanial McConnell
 
Rails tools
Reuven Lerner
 
Capistrano Deployment By Nyros Developer
Nyros Technologies
 
2018 RubyHACK: put git to work - increase the quality of your rails project...
Rodrigo Urubatan
 
Rock Solid Deployment of Web Applications
Pablo Godel
 
Empowered productivity
Giedrius Rimkus
 
2018 the conf put git to work - increase the quality of your rails project...
Rodrigo Urubatan
 
Porting Rails Apps to High Availability Systems
Marcelo Pinheiro
 
Ruby on Rails Kickstart 101 & 102
Heng-Yi Wu
 
Ruby v cpp_preso
jessicard
 
Railsconf2011 deployment tips_for_slideshare
tomcopeland
 
DiUS Computing Lca Rails Final
Robert Postill
 
Ruby on Rails survival guide of an aged Java developer
gicappa
 
First app
Benjamin Taylor
 
Automated Releases to RubyGems.org using Travis-CI.org
Francis Luong
 
DCRUG: Achieving Development-Production Parity
Geoff Harcourt
 
Developing Rails Apps in Technical Isolation
Jesus Jackson
 
An introduction to Rails 3
Blazing Cloud
 
Ad

Toolbox of a Ruby Team

  • 1. Toolbox of a Ruby team
  • 3. The basics of development in a team ● A code repository ● Consistent development environment ● Code quality and code style consistency ● CI and deployment procedure ● Error tracking ● Communication
  • 4. Issue tracking? ● Jira ● Pivotal Tracker ● Trello
  • 5. Development environment ● No need for a virtual machine! ● rvm ● .env ● Database - Postgres App ● Pow
  • 6. is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems.
  • 7. Examples >rvm use 2.1.1 >rvm gemset create rails4 >rvm use 2.1.1@rails4 >gem install … >bundle install …
  • 8. .ruby-version, .ruby-gemset Specify the gemset name and ruby version by including these two files in the root folder of the Rails project.
  • 9. .env Shim to load environment variables from .env into ENV in development. gem ‘dotenv-rails’
  • 10. .env example FACEBOOK_API_KEY=f4c3b00kt3st GA_CODE=UA-546094580-1 MAIL_HOSTNAME=example.com
  • 11. Postgres.app The easiest way to get started with PostgreSQL on the Mac rake db:create db:migrate
  • 12. Pow: Zero-configuration Rack server for Mac OS X $ cd ~/.pow $ ln -s /path/to/myapp Then just go to http://myapp.dev/ and POW, it’s running (or maybe you forgot to run bundle install)!
  • 13. .powrc if [ -f "$rvm_path/scripts/rvm" ]; then source "$rvm_path/scripts/rvm" rvm use . fi
  • 14. Development environment setup steps: >git clone [git repo] >cd newapp ruby-2.1.2 - #gemset created /Users/user/.rvm/gems/ruby-2.1.2@newapp ruby-2.1.2 - #generating newapp wrappers - please wait >bundle install … >rake db:create db:migrate … >cd ~/.pow >ln -s /path/to/newapp http://newap.dev/
  • 15. Code style and consistency The Ruby and RoR community is strict when it comes to coding style and conventions! This is really helpful for teams working on projects, onboarding of new developers is easy.
  • 16. Sublime Text settings For basic stuff, there’s these Sublime settings: ● Auto-delete trailing whitespaces ● Add newlines at the end of files This will save you a bunch of unnecessary headaches.
  • 17. Mandatory Sublime Settings // Set to true to removing trailing whitespace on save "trim_trailing_white_space_on_save": true, // Set to true to ensure the last line of the file ends in a newline // character when saving "ensure_newline_at_eof_on_save": true,
  • 18. Code quality ● Code review! ● Naforo - not currently maintained :( ● Github pull requests - good enough
  • 19. Pull Requests When merging feature branches into master, do it via pull requests - this provides good basics for code review.
  • 20. Code repository ● Git ● When pulling from origin, do it using the -- rebase option, to avoid unnecessary merge commits ● Don’t change merge commit messages! ● Is it sometimes acceptable to do a force push, to make the repo cleaner?
  • 21. CI and Deployment ● Heroku - making it super simple, but has downsides ● Mina and Capistrano ● Circle CI
  • 22. Easy to configure, runs tests, deploys code. Hooks up to github, so it all runs every time you push something into the repo. Deployment procedure descirbed in the circle.yml file.
  • 23. Example circle.yml machine: services: - postgresql deployment: staging: branch: master commands: - '[[ ! -s "$(git rev-parse --git-dir)/shallow" ]] || git fetch --unshallow' - git push --force [email protected]:staging-theapp.git $CIRCLE_SHA1:master: timeout: 900 - heroku run rake db:migrate --app staging-theapp - curl https://api.rollbar.com/api/1/deploy/ -F access_token=$RB_AT -F environment=staging -F revision=$(git log -n 1 --pretty=format:"%H") -F local_username=CircleCI
  • 24. Example circle.yml production: branch: production commands: - '[[ ! -s "$(git rev-parse --git-dir)/shallow" ]] || git fetch --unshallow' - git push --force [email protected]:production-theapp.git $CIRCLE_SHA1:master: timeout: 900 - heroku run rake db:migrate --app production-theapp - git config user.name "DLabs CircleCi" - git config user.email "[email protected]" - git tag -a $(date "+%Y%m%d%H%M")-production $CIRCLE_SHA1 -m "$(date "+%Y%m%d%H%M") deployed to production" - '[[ ! -s "$(git rev-parse --git-dir)/shallow" ]] || git fetch --unshallow' - git push [email protected]:dlabs/theapp.git --tags - curl https://api.rollbar.com/api/1/deploy/ -F access_token=$RB_ATP -F environment=production -F revision=$(git log -n 1 --pretty=format:"%H") -F local_username=CircleCI
  • 25. Wonders of Heroku Super easy to deploy and scale your app. Just push into your Heroku app’s repo and it will set it up automatically. Use $$$liders to scale up your app! No static IP DNS is tricky (many DNS providers don’t offer CNAME domain records for root domains), if you need a static IP, you’ll need to set up your own proxy or use Proximo($$$).
  • 26. $ bundle exec cap staging deploy $ bundle exec cap production deploy
  • 27. Example Capistrano Task server 'example.com', roles: [:web, :app] server 'example.org', roles: [:db, :workers] desc "Report Uptimes" task :uptime do on roles(:all) do |host| execute :any_command, "with args", :here, "and here" info "Host #{host} (#{host.roles.to_a.join(', ')}):t#{capture(:uptime)}" end end
  • 28. Really fast deployer and server automation tool “Mina works really fast because it’s a deploy Bash script generator. It generates an entire procedure as a Bash script and runs it remotely in the server”
  • 29. Mina example deploy $ mina deploy --verbose -----> Creating the build path $ mkdir tmp/build-128293482394 -----> Cloning the Git repository $ git clone https://github.com/nadarei/flipstack.git . -n --recursive Cloning... done. -----> Installing gem dependencies using Bundler $ bundle install --without development:test Using i18n (0.6.0) Using multi_json (1.0.4) ... Your bundle is complete! It was installed to ./vendor/bundle -----> Moving to releases/4 $ mv "./tmp/build-128293482394" "releases/4" -----> Symlinking to current $ ln -nfs releases/4 current -----> Launching $ cd releases/4 $ sudo service nginx restart -----> Done. Deployed v4
  • 30. Error Tracking Watch those overage fees!!! Also includes some handy performance metrics
  • 31. WebHooks: ● github pushes ● CI - tests and deployment ● code review notifications ● error tracking Animated GIFs!
  • 35. HipChat - Error Tracking :(
  • 36. HipChat - Cat Facts
  • 37. ?
  • 38. Links http://rvm.io/ http://postgresapp.com/ http://pow.cx/ http://www.sublimetext.com/ https://circleci.com/ http://nadarei.co/mina/ http://capistranorb.com/ https://www.hipchat.com/ https://www.heroku.com/ https://rollbar.com https://appsignal.com/