ºÝºÝߣ

ºÝºÝߣShare 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/
Ad

Recommended

Deployment with capistrano
Deployment with capistrano
sagar junnarkar
?
Capistrano - Deployment Tool
Capistrano - Deployment Tool
Nyros Technologies
?
Control your deployments with Capistrano
Control your deployments with Capistrano
Ramazan K
?
Capistrano
Capistrano
Jason Noble
?
Ruby on Rails and Docker - Why should I care?
Ruby on Rails and Docker - Why should I care?
Adam Hodowany
?
Capistrano - automate all the things
Capistrano - automate all the things
John Cleary
?
Taming AEM deployments
Taming AEM deployments
Jakub Wadolowski
?
Getting Started with Capistrano
Getting Started with Capistrano
LaunchAny
?
Into The Box 2018 Going live with commandbox and docker
Into The Box 2018 Going live with commandbox and docker
Ortus Solutions, Corp
?
Capistrano 3 Deployment
Capistrano 3 Deployment
Creston Jamison
?
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
?ilvinas Kuusas
?
Learn basic ansible using docker
Learn basic ansible using docker
Larry Cai
?
A quick intro to Ansible
A quick intro to Ansible
Dan Vaida
?
Deployment with Fabric
Deployment with Fabric
andymccurdy
?
Python Deployment with Fabric
Python Deployment with Fabric
andymccurdy
?
Using rbenv in Production
Using rbenv in Production
Nic Benders
?
Provisioning iOS CI Server with Ansible
Provisioning iOS CI Server with Ansible
Shashikant Jagtap
?
Ansible, best practices
Ansible, best practices
Bas Meijer
?
Background processing with Resque
Background processing with Resque
Nicolas Blanco
?
JavaScript Task Runners - Gulp & Grunt
JavaScript Task Runners - Gulp & Grunt
Lohith Goudagere Nagaraj
?
Introduction to ansible galaxy
Introduction to ansible galaxy
Ivan Serdyuk
?
DevOps tools for everyone - Vagrant, Puppet and Webmin
DevOps tools for everyone - Vagrant, Puppet and Webmin
postrational
?
ÒÔ Laravel ½›òžé_°l Hyperf ‘ªÓÃ
ÒÔ Laravel ½›òžé_°l Hyperf ‘ªÓÃ
Shengyou Fan
?
Puppet in the Pipeline
Puppet in the Pipeline
Puppet
?
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
?
PDXPortland - Dockerize Django
PDXPortland - Dockerize Django
Hannes Hapke
?
GPerf Using Jesque
GPerf Using Jesque
ctoestreich
?
Infrastructure = Code
Infrastructure = Code
Georg Sorst
?
Getting started
Getting started
Lisa McCarthy
?
Testiranje s capybaro
Testiranje s capybaro
Arto Artnik
?

More Related Content

What's hot (20)

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

Viewers also liked (10)

Getting started
Getting started
Lisa McCarthy
?
Testiranje s capybaro
Testiranje s capybaro
Arto Artnik
?
PCI DSS v 2.0 - Don't Fall In. Short & high level presentation for the Ecomme...
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
'Video for Business': Webvideos seminar at The Business Show 2013 - London
Web Videos
?
Game Of Thrones - Fenomenologia dei Media
Game Of Thrones - Fenomenologia dei Media
Francesca Tessaroli
?
¦Ö¦Ñ¦É¦Ò¦Ó¦Ï¦Ô¦Ã¦Å¦Í¦Í¦Á ¦Ò¦Ó¦Ï ¦Ò¦Ð¦É¦Ó¦É_¦Ó¦Ï¦Ô_¦Á¦Ç-¦Â¦Á¦Ò¦É¦Ë¦Ç_¦Á¦Ç_¦Ï¦Ê____________ (1)
¦Ö¦Ñ¦É¦Ò¦Ó¦Ï¦Ô¦Ã¦Å¦Í¦Í¦Á ¦Ò¦Ó¦Ï ¦Ò¦Ð¦É¦Ó¦É_¦Ó¦Ï¦Ô_¦Á¦Ç-¦Â¦Á¦Ò¦É¦Ë¦Ç_¦Á¦Ç_¦Ï¦Ê____________ (1)
¦¥¦Ô¦Á¦Ã¦Ã¦Å¦Ë?¦Á ¦³¦Ñ¦É¦Á¦Í¦Ó¦Á¦Õ?¦Ë¦Ë¦Ï¦Ô
?
ÔªÖÇ´óŒW ԭζÊм¯.Ï£ÍûÞrˆö(ˆó¸æ)
ÔªÖÇ´óŒW ԭζÊм¯.Ï£ÍûÞrˆö(ˆó¸æ)
nehemiah0000
?
Libro de ejercicio word 2007
Libro de ejercicio word 2007
luchilita
?
Testiranje s capybaro
Testiranje s capybaro
Arto Artnik
?
PCI DSS v 2.0 - Don't Fall In. Short & high level presentation for the Ecomme...
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
'Video for Business': Webvideos seminar at The Business Show 2013 - London
Web Videos
?
Game Of Thrones - Fenomenologia dei Media
Game Of Thrones - Fenomenologia dei Media
Francesca Tessaroli
?
¦Ö¦Ñ¦É¦Ò¦Ó¦Ï¦Ô¦Ã¦Å¦Í¦Í¦Á ¦Ò¦Ó¦Ï ¦Ò¦Ð¦É¦Ó¦É_¦Ó¦Ï¦Ô_¦Á¦Ç-¦Â¦Á¦Ò¦É¦Ë¦Ç_¦Á¦Ç_¦Ï¦Ê____________ (1)
¦Ö¦Ñ¦É¦Ò¦Ó¦Ï¦Ô¦Ã¦Å¦Í¦Í¦Á ¦Ò¦Ó¦Ï ¦Ò¦Ð¦É¦Ó¦É_¦Ó¦Ï¦Ô_¦Á¦Ç-¦Â¦Á¦Ò¦É¦Ë¦Ç_¦Á¦Ç_¦Ï¦Ê____________ (1)
¦¥¦Ô¦Á¦Ã¦Ã¦Å¦Ë?¦Á ¦³¦Ñ¦É¦Á¦Í¦Ó¦Á¦Õ?¦Ë¦Ë¦Ï¦Ô
?
ÔªÖÇ´óŒW ԭζÊм¯.Ï£ÍûÞrˆö(ˆó¸æ)
ÔªÖÇ´óŒW ԭζÊм¯.Ï£ÍûÞrˆö(ˆó¸æ)
nehemiah0000
?
Libro de ejercicio word 2007
Libro de ejercicio word 2007
luchilita
?
Ad

Similar to Toolbox of a Ruby Team (20)

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