SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
DEPLOY MADE EASY
(even on Friday)
Riccardo Bini
@odracci
In the beginning
F
A
I
L
DEPLOYTOOLS
• Idephix
• puppet
• fabric
CAPISTRANO
Capistrano is an open source tool for running scripts on
multiple servers; its main use is deploying web applications. It
automates the process of making a new version of an
application available on one or more web servers, including
supporting tasks such as changing databases.
http://en.wikipedia.org/wiki/Capistrano
WHY?
One-click deploy
Deploy in transaction
Rollback
Automated tasks (minifing CSS/JS, DB migrations)
RECIPES
Capifony http://capifony.org
Railsless-deploy https://github.com/leehambley/railsless-deploy
Multistage https://github.com/capistrano/capistrano/wiki/2.x-Multistage-Extension
`-- /var/www/my-app.com
|-- current ! /var/www/my-app.com/releases/20131004131539
|-- releases
| `-- 20131004131539
| `-- 20131004150741
| `-- 20131004145325
`-- shared
|-- web
| `-- uploads
`-- config
`-- config.php
HOW IT WORKS
HOW IT WORKS
ssh to the server (my-app.com)
• create a new release path (/var/www/my-app.com/releases/...)
• pull the latest project version from the remote git repo
• copy the source code, pulled from git, into the release path
http://capifony.org
HOW IT WORKS
$ capify .
[add] writing './Capfile'
[add] making directory './config'
[add] writing './config/deploy.rb'
[done] capified!
SETUP
$ cap deploy:setup
# to deploy: cap -S branch=<branchname> deploy
set :application, "set your application name here"
set :repository, "git@github.com:odracci/#{application}.git"
set :scm, :git
server "my-app.com", :app, :web, :db, :primary => true
set :deploy_to, "/var/www/my-app.com"
set :branch, fetch(:branch, "master")
set :shared_children, ["web/uploads", "config"]
set :user, "vagrant"
set :group_writable, true
set :use_sudo, false
set :copy_exclude, [".git"]
set :deploy_via, :remote_cache
set :keep_releases, 5
ssh_options[:forward_agent] = true
default_run_options[:pty] = true
logger.level = Logger::MAX_LEVEL
# if you want to clean up old releases on each deploy uncomment this:
after "deploy:restart", "deploy:cleanup"
config/deploy.rb
$ cap <env> deploy
server "www.my-app.com", :app, :web, :db, :primary => true
set :deploy_to, "/var/www/my-app.com"
set :branch, fetch(:branch, "master")
MULTISTAGE
server "s.my-app.com", :app, :web, :db, :primary => true
set :deploy_to, "/var/www/my-app.com"
set :branch, fetch(:branch, "develop")
config/deploy/production.rb
config/deploy/staging.rb
command line
cap deploy # Deploys your project.
cap deploy:check # Test deployment dependencies.
cap deploy:cleanup # Clean up old releases.
cap deploy:cold # Deploys and starts a `cold' application.
cap deploy:create_symlink # Updates the symlink to the most recently deployed...
cap deploy:migrate # Run the migrate rake task.
cap deploy:migrations # Deploy and run pending migrations.
cap deploy:pending # Displays the commits since your last deploy.
cap deploy:pending:diff # Displays the `diff' since your last deploy.
cap deploy:restart # Blank task exists as a hook into which to install...
cap deploy:rollback # Rolls back to a previous version and restarts.
cap deploy:rollback:code # Rolls back to the previously deployed version.
cap deploy:setup # Prepares one or more servers for deployment.
cap deploy:start # Blank task exists as a hook into which to install...
cap deploy:stop # Blank task exists as a hook into which to install...
cap deploy:symlink # Deprecated API.
cap deploy:update # Copies your project and updates the symlink.
cap deploy:update_code # Copies your project to the remote servers.
cap deploy:upload # Copy files to the currently deployed version.
cap invoke # Invoke a single command on the remote servers.
cap shell # Begin an interactive Capistrano session.
cap -T
namespace :deploy do
task :start do
end
task :stop do
end
task :restart, :roles => :app, :except => { :no_release => true } do
run "sudo /etc/init.d/httpd restart"
end
end
OverrideTasks
namespace :config do
desc "Upload config/config.php to remote server"
task :to_remote do
upload("config/config.php", "#{shared_path}/config/config.php", :via => :scp)
end
end
$ cap config:to_remote
CustomTasks
WTF
[my-app.com] executing command
** [my-app.com :: out] Permission denied (publickey).
** [my-app.com :: out]
** [my-app.com :: out] fatal: The remote end hung up unexpectedly
** [my-app.com :: out]
command finished in 2769ms
*** [deploy:update_code] rolling back
WTF
$ ssh-add
namespace :deploy do
	 desc 'Show deployed revision'
	 task :revision, :roles => :app do
	 	 run "#{try_sudo} cat #{current_path}/REVISION"
	 end
end
WTF
$ cap deploy:revision
#server "server1, :app, :web, :db, :primary => true
role :app, "server1", "server2"
role :web, "server1", "server2"
role :db, "dbserver", :primary => true
SCALING WEB APPS
$ cap deploy:setup
THANKS
Riccardo Bini
@odracci
github.com/odracci
QUESTIONS?

Contenu connexe

Tendances

Tendances (20)

Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As CodeDevops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
Devops Boise - Israel Shirk - Pragmatic Migration to Infrastructure As Code
 
CI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOWCI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOW
 
ConcourseCi overview
ConcourseCi  overviewConcourseCi  overview
ConcourseCi overview
 
Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3Server(less) Swift at SwiftCloudWorkshop 3
Server(less) Swift at SwiftCloudWorkshop 3
 
Sprint 17
Sprint 17Sprint 17
Sprint 17
 
Install Concourse CI with BOSH
Install Concourse CI with BOSHInstall Concourse CI with BOSH
Install Concourse CI with BOSH
 
Concourse updates
Concourse updatesConcourse updates
Concourse updates
 
2016 05-cloudsoft-amp-and-brooklyn-new
2016 05-cloudsoft-amp-and-brooklyn-new2016 05-cloudsoft-amp-and-brooklyn-new
2016 05-cloudsoft-amp-and-brooklyn-new
 
Gitlab ci-cd
Gitlab ci-cdGitlab ci-cd
Gitlab ci-cd
 
Deploying an application with Chef and Docker
Deploying an application with Chef and DockerDeploying an application with Chef and Docker
Deploying an application with Chef and Docker
 
創科 從零開始認識 Docker
創科 從零開始認識 Docker創科 從零開始認識 Docker
創科 從零開始認識 Docker
 
OpenWhisk
OpenWhiskOpenWhisk
OpenWhisk
 
Codecoon - A technical Case Study
Codecoon - A technical Case StudyCodecoon - A technical Case Study
Codecoon - A technical Case Study
 
Continuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and JenkinsContinuous Delivery Pipeline with Docker and Jenkins
Continuous Delivery Pipeline with Docker and Jenkins
 
Developing Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus IbsenDeveloping Microservices with Apache Camel, by Claus Ibsen
Developing Microservices with Apache Camel, by Claus Ibsen
 
Concourse CI Meetup Demo
Concourse CI Meetup DemoConcourse CI Meetup Demo
Concourse CI Meetup Demo
 
Auto-scaled Concourse CI on AWS w/o BOSH
Auto-scaled Concourse CI on AWS w/o BOSHAuto-scaled Concourse CI on AWS w/o BOSH
Auto-scaled Concourse CI on AWS w/o BOSH
 

En vedette

En vedette (12)

Onnichannel Experience - 'Caso Mi Canal IKEA Ibérica'
Onnichannel Experience - 'Caso Mi Canal IKEA Ibérica' Onnichannel Experience - 'Caso Mi Canal IKEA Ibérica'
Onnichannel Experience - 'Caso Mi Canal IKEA Ibérica'
 
5 Tips for Team Management
5 Tips for Team Management5 Tips for Team Management
5 Tips for Team Management
 
IQ Assurance & Testing: Did you know...?
IQ Assurance & Testing: Did you know...?IQ Assurance & Testing: Did you know...?
IQ Assurance & Testing: Did you know...?
 
IQ Assurance & Testing Brochure
IQ Assurance & Testing BrochureIQ Assurance & Testing Brochure
IQ Assurance & Testing Brochure
 
Spotlight on Jet2.com - Interview with Stuart Bass, B.I. Applications Manager
Spotlight on Jet2.com - Interview with Stuart Bass, B.I. Applications ManagerSpotlight on Jet2.com - Interview with Stuart Bass, B.I. Applications Manager
Spotlight on Jet2.com - Interview with Stuart Bass, B.I. Applications Manager
 
A Task Scheduling Algorithm in Cloud Computing
A Task Scheduling Algorithm in Cloud ComputingA Task Scheduling Algorithm in Cloud Computing
A Task Scheduling Algorithm in Cloud Computing
 
coma Study Room Arduino Workshop
coma Study Room Arduino Workshopcoma Study Room Arduino Workshop
coma Study Room Arduino Workshop
 
Job Searching: 5 Top Tips for Effective Job Searching
Job Searching: 5 Top Tips for Effective Job SearchingJob Searching: 5 Top Tips for Effective Job Searching
Job Searching: 5 Top Tips for Effective Job Searching
 
Iq work hacks round up
Iq work hacks round upIq work hacks round up
Iq work hacks round up
 
IQ Survival Guide - Personal Twitter
IQ Survival Guide - Personal TwitterIQ Survival Guide - Personal Twitter
IQ Survival Guide - Personal Twitter
 
淺談 Live patching technology
淺談 Live patching technology淺談 Live patching technology
淺談 Live patching technology
 
I'm A STEM Graduate, I'm Struggling To get An Interview - Help!
I'm A STEM Graduate, I'm Struggling To get An Interview - Help!I'm A STEM Graduate, I'm Struggling To get An Interview - Help!
I'm A STEM Graduate, I'm Struggling To get An Interview - Help!
 

Similaire à Deploy made easy (even on Friday)

Similaire à Deploy made easy (even on Friday) (20)

Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Deploying Rails Apps with Capistrano
Deploying Rails Apps with CapistranoDeploying Rails Apps with Capistrano
Deploying Rails Apps with Capistrano
 
Capistrano - Deployment Tool
Capistrano - Deployment ToolCapistrano - Deployment Tool
Capistrano - Deployment Tool
 
Control your deployments with Capistrano
Control your deployments with CapistranoControl your deployments with Capistrano
Control your deployments with Capistrano
 
Painless Deployment with Capistrano
Painless Deployment with CapistranoPainless Deployment with Capistrano
Painless Deployment with Capistrano
 
DCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application PackagesDCEU 18: App-in-a-Box with Docker Application Packages
DCEU 18: App-in-a-Box with Docker Application Packages
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Enabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @OrbitzEnabling Hybrid Workflows with Docker/Mesos @Orbitz
Enabling Hybrid Workflows with Docker/Mesos @Orbitz
 
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
ZFConf 2012: Capistrano для деплоймента PHP-приложений (Роман Лапин)
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
(ARC402) Deployment Automation: From Developers' Keyboards to End Users' Scre...
 
Docker for Dummies
Docker for DummiesDocker for Dummies
Docker for Dummies
 
Capistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros DeveloperCapistrano Deployment By Nyros Developer
Capistrano Deployment By Nyros Developer
 
Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
DevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux ContainersDevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux Containers
 
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
 
Deploying Symfony | symfony.cat
Deploying Symfony | symfony.catDeploying Symfony | symfony.cat
Deploying Symfony | symfony.cat
 
Deploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using SurfDeploying TYPO3 Neos websites using Surf
Deploying TYPO3 Neos websites using Surf
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Deploy made easy (even on Friday)

  • 1. DEPLOY MADE EASY (even on Friday) Riccardo Bini @odracci
  • 3.
  • 6. CAPISTRANO Capistrano is an open source tool for running scripts on multiple servers; its main use is deploying web applications. It automates the process of making a new version of an application available on one or more web servers, including supporting tasks such as changing databases. http://en.wikipedia.org/wiki/Capistrano
  • 7. WHY? One-click deploy Deploy in transaction Rollback Automated tasks (minifing CSS/JS, DB migrations)
  • 9. `-- /var/www/my-app.com |-- current ! /var/www/my-app.com/releases/20131004131539 |-- releases | `-- 20131004131539 | `-- 20131004150741 | `-- 20131004145325 `-- shared |-- web | `-- uploads `-- config `-- config.php HOW IT WORKS
  • 10. HOW IT WORKS ssh to the server (my-app.com) • create a new release path (/var/www/my-app.com/releases/...) • pull the latest project version from the remote git repo • copy the source code, pulled from git, into the release path http://capifony.org
  • 12. $ capify . [add] writing './Capfile' [add] making directory './config' [add] writing './config/deploy.rb' [done] capified! SETUP $ cap deploy:setup
  • 13. # to deploy: cap -S branch=<branchname> deploy set :application, "set your application name here" set :repository, "git@github.com:odracci/#{application}.git" set :scm, :git server "my-app.com", :app, :web, :db, :primary => true set :deploy_to, "/var/www/my-app.com" set :branch, fetch(:branch, "master") set :shared_children, ["web/uploads", "config"] set :user, "vagrant" set :group_writable, true set :use_sudo, false set :copy_exclude, [".git"] set :deploy_via, :remote_cache set :keep_releases, 5 ssh_options[:forward_agent] = true default_run_options[:pty] = true logger.level = Logger::MAX_LEVEL # if you want to clean up old releases on each deploy uncomment this: after "deploy:restart", "deploy:cleanup" config/deploy.rb
  • 14. $ cap <env> deploy server "www.my-app.com", :app, :web, :db, :primary => true set :deploy_to, "/var/www/my-app.com" set :branch, fetch(:branch, "master") MULTISTAGE server "s.my-app.com", :app, :web, :db, :primary => true set :deploy_to, "/var/www/my-app.com" set :branch, fetch(:branch, "develop") config/deploy/production.rb config/deploy/staging.rb command line
  • 15. cap deploy # Deploys your project. cap deploy:check # Test deployment dependencies. cap deploy:cleanup # Clean up old releases. cap deploy:cold # Deploys and starts a `cold' application. cap deploy:create_symlink # Updates the symlink to the most recently deployed... cap deploy:migrate # Run the migrate rake task. cap deploy:migrations # Deploy and run pending migrations. cap deploy:pending # Displays the commits since your last deploy. cap deploy:pending:diff # Displays the `diff' since your last deploy. cap deploy:restart # Blank task exists as a hook into which to install... cap deploy:rollback # Rolls back to a previous version and restarts. cap deploy:rollback:code # Rolls back to the previously deployed version. cap deploy:setup # Prepares one or more servers for deployment. cap deploy:start # Blank task exists as a hook into which to install... cap deploy:stop # Blank task exists as a hook into which to install... cap deploy:symlink # Deprecated API. cap deploy:update # Copies your project and updates the symlink. cap deploy:update_code # Copies your project to the remote servers. cap deploy:upload # Copy files to the currently deployed version. cap invoke # Invoke a single command on the remote servers. cap shell # Begin an interactive Capistrano session. cap -T
  • 16. namespace :deploy do task :start do end task :stop do end task :restart, :roles => :app, :except => { :no_release => true } do run "sudo /etc/init.d/httpd restart" end end OverrideTasks
  • 17. namespace :config do desc "Upload config/config.php to remote server" task :to_remote do upload("config/config.php", "#{shared_path}/config/config.php", :via => :scp) end end $ cap config:to_remote CustomTasks
  • 18. WTF
  • 19. [my-app.com] executing command ** [my-app.com :: out] Permission denied (publickey). ** [my-app.com :: out] ** [my-app.com :: out] fatal: The remote end hung up unexpectedly ** [my-app.com :: out] command finished in 2769ms *** [deploy:update_code] rolling back WTF $ ssh-add
  • 20. namespace :deploy do desc 'Show deployed revision' task :revision, :roles => :app do run "#{try_sudo} cat #{current_path}/REVISION" end end WTF $ cap deploy:revision
  • 21. #server "server1, :app, :web, :db, :primary => true role :app, "server1", "server2" role :web, "server1", "server2" role :db, "dbserver", :primary => true SCALING WEB APPS $ cap deploy:setup