SlideShare una empresa de Scribd logo
1 de 26
Capistrano at your command
                                 Tips and tricks, from wimp to winner

Lee Hambley - August 20th 2009
                                                                        1
What’s on the menu?

✤   Capistrano’s Structure

    ✤   Net::SSH

✤   The Scope of Execution

✤   Task chaining; your own multi-stage

✤   Streams

✤   Prompts

                                          2
Simply put, Capistrano is a tool for automating
                                                tasks on one or more remote servers. It executes
                                                commands in parallel on all targeted machines,
                                                and provides a mechanism for rolling back

      Capistrano                                changes across multiple machines. It is ideal for
                                                anyone doing any kind of system administration,
                                                either professionally or incidentally.


                                                What’s in the Box?

    Net::SSH             Net::SFTP   Net::SCP




     Net::SSH::Gateway




                                                          $ gem dependency capistrano
                                                            Gem capistrano-2.5.8


Capistrano’s Structure                                        net-ssh (>= 2.0.10, runtime)
                                                              net-sftp (>= 2.0.0, runtime)
                                                              net-scp (>= 1.0.0, runtime)
                                                              net-ssh-gateway (>= 1.0.0, runtime)




                                                                                                    3
Simply put, Capistrano is a tool for automating
                                                tasks on one or more remote servers. It executes
                                                commands in parallel on all targeted machines,
                                                and provides a mechanism for rolling back

      Capistrano                                changes across multiple machines. It is ideal for
                                                anyone doing any kind of system administration,
                                                either professionally or incidentally.


                                                What’s in the Box?
                                                ✤   Consistent support for different source
                                                    control software.
    Net::SSH             Net::SFTP   Net::SCP




     Net::SSH::Gateway




                                                          $ gem dependency capistrano
                                                            Gem capistrano-2.5.8


Capistrano’s Structure                                        net-ssh (>= 2.0.10, runtime)
                                                              net-sftp (>= 2.0.0, runtime)
                                                              net-scp (>= 1.0.0, runtime)
                                                              net-ssh-gateway (>= 1.0.0, runtime)




                                                                                                    3
Simply put, Capistrano is a tool for automating
                                                tasks on one or more remote servers. It executes
                                                commands in parallel on all targeted machines,
                                                and provides a mechanism for rolling back

      Capistrano                                changes across multiple machines. It is ideal for
                                                anyone doing any kind of system administration,
                                                either professionally or incidentally.


                                                What’s in the Box?
                                                ✤   Consistent support for different source
                                                    control software.
    Net::SSH             Net::SFTP   Net::SCP   ✤   Rake-esque task definitions, including
                                                    before/after callbacks for method
                                                    chaining.

     Net::SSH::Gateway




                                                          $ gem dependency capistrano
                                                            Gem capistrano-2.5.8


Capistrano’s Structure                                        net-ssh (>= 2.0.10, runtime)
                                                              net-sftp (>= 2.0.0, runtime)
                                                              net-scp (>= 1.0.0, runtime)
                                                              net-ssh-gateway (>= 1.0.0, runtime)




                                                                                                    3
Simply put, Capistrano is a tool for automating
                                                tasks on one or more remote servers. It executes
                                                commands in parallel on all targeted machines,
                                                and provides a mechanism for rolling back

      Capistrano                                changes across multiple machines. It is ideal for
                                                anyone doing any kind of system administration,
                                                either professionally or incidentally.


                                                What’s in the Box?
                                                ✤   Consistent support for different source
                                                    control software.
    Net::SSH             Net::SFTP   Net::SCP   ✤   Rake-esque task definitions, including
                                                    before/after callbacks for method
                                                    chaining.

     Net::SSH::Gateway
                                                ✤   Ability to detect and rollback broken jobs
                                                    using transactions




                                                          $ gem dependency capistrano
                                                            Gem capistrano-2.5.8


Capistrano’s Structure                                        net-ssh (>= 2.0.10, runtime)
                                                              net-sftp (>= 2.0.0, runtime)
                                                              net-scp (>= 1.0.0, runtime)
                                                              net-ssh-gateway (>= 1.0.0, runtime)




                                                                                                    3
Simply put, Capistrano is a tool for automating
                                                tasks on one or more remote servers. It executes
                                                commands in parallel on all targeted machines,
                                                and provides a mechanism for rolling back

      Capistrano                                changes across multiple machines. It is ideal for
                                                anyone doing any kind of system administration,
                                                either professionally or incidentally.


                                                What’s in the Box?
                                                ✤   Consistent support for different source
                                                    control software.
    Net::SSH             Net::SFTP   Net::SCP   ✤   Rake-esque task definitions, including
                                                    before/after callbacks for method
                                                    chaining.

     Net::SSH::Gateway
                                                ✤   Ability to detect and rollback broken jobs
                                                    using transactions
                                                ✤   Roles, :app, :web, :db & :define-your-own




                                                          $ gem dependency capistrano
                                                            Gem capistrano-2.5.8


Capistrano’s Structure                                        net-ssh (>= 2.0.10, runtime)
                                                              net-sftp (>= 2.0.0, runtime)
                                                              net-scp (>= 1.0.0, runtime)
                                                              net-ssh-gateway (>= 1.0.0, runtime)




                                                                                                    3
Net::SSH

✤   Magical pure-Ruby
    implementation of the SSH
    protocol.

✤   Honours your ~/ssh/config
    settings.

✤   Supports (creating and using)
    Tunnels, Gateways, Agent
    Forwarding and more...

✤   Super clean syntax...
Net::SSH

✤   Magical pure-Ruby
    implementation of the SSH
    protocol.

✤   Honours your ~/ssh/config
    settings.

✤   Supports (creating and using)
    Tunnels, Gateways, Agent
    Forwarding and more...

✤   Super clean syntax...
Net::SSH

✤   Magical pure-Ruby
    implementation of the SSH
    protocol.

✤   Honours your ~/ssh/config
    settings.

✤   Supports (creating and using)
    Tunnels, Gateways, Agent
    Forwarding and more...

✤   Super clean syntax...
The Scope of Execution

✤   What runs where?

✤   What permissions will I need?

✤   Obscure errors about permissions?

✤   .. lots of different things happening
The Scope of Execution
        $   → cap deploy
                                                                                 Calling another Capistrano task.
     * executing `deploy'

     * executing `deploy:update'                                                 Transactions, you can define what to do for
                                                                                 your own transactions if a task within it fails.
    ** transaction: start




{
     * executing `deploy:update_code'                                            A shell command run on your workstation.

    executing locally: "git ls-remote git@github.com:leehambley/
capistrano-website.git HEAD"
                                                                                 A shell command run remotely.
  * executing "git clone -q git@github.com:leehambley/capistrano-
website.git /u/apps/capistrano-website/releases/20090820114515 && ...... "




{
     * executing `deploy:finalize_update'                                        A shell command run remotely, connecting
                                                                                 to your repository server. †
  * executing "chmod -R g+w /u/apps/capistrano-website/releases/
20090820114515"




{
     * executing `deploy:symlink'

  * executing "rm -f /u/apps/capistrano-website/current && ln -s /u/apps/
capistrano-website/releases/20090820114515 /u/apps/capistrano-website/
current"

    ** transaction: commit                                                        † Requires passwordless access to your repository
                                                                             server from your servers; this can be either keys (GitHub
                                                                             deploy keys feature) or SSH agent forwarding to provide
                                                                                                               your own key by proxy
Task Chaining

          ➊        ➋      ➌
$ rake db:migrate spec features
Task Chaining

          ➊        ➋      ➌
$ rake db:migrate spec features

              ➊            ➋
$ cap check-ruby-version deploy
Task Chaining

          ➊        ➋      ➌
$ rake db:migrate spec features   -----------------

              ➊            ➋
$ cap check-ruby-version deploy
Task Chaining

          ➊        ➋      ➌
$ rake db:migrate spec features   -----------------

              ➊            ➋
$ cap check-ruby-version deploy




                                                                                     capture
                                          Executes a command on a single host and returns
                                                          ("captures") the output as a string.
                                                                                       stream
                                           Very similar to run, but optimised for displaying
                                              live streams of text (like tailed log files) from
                                                                               multiple hosts.
                                                                                           run
                                                Execute commands on one or more servers
Task Chaining

          ➊        ➋       ➌
$ rake db:migrate spec features        -----------------

              ➊            ➋
$ cap check-ruby-version deploy

        ➊              ➋           ➌
$ cap staging check-ruby-version deploy




                                                                                          capture
                                               Executes a command on a single host and returns
                                                               ("captures") the output as a string.
                                                                                            stream
                                                Very similar to run, but optimised for displaying
                                                   live streams of text (like tailed log files) from
                                                                                    multiple hosts.
                                                                                                run
                                                     Execute commands on one or more servers
Task Chaining

          ➊        ➋       ➌
$ rake db:migrate spec features        -----------------

              ➊            ➋
$ cap check-ruby-version deploy

        ➊              ➋           ➌
$ cap staging check-ruby-version deploy




                                                                                          capture
                                               Executes a command on a single host and returns
                                                               ("captures") the output as a string.
                                                                                            stream
                                                Very similar to run, but optimised for displaying
                                                   live streams of text (like tailed log files) from
                                                                                    multiple hosts.
                                                                                                run
                                                     Execute commands on one or more servers
Streams?
In Unix and Unix-like operating systems, as well as certain
programming language interfaces, the standard streams are
pre-connected input and output channels between a
computer program and its environment (typically a text
terminal) when it begins execution. The three I/O
connections are called standard input, standard output and
standard error.
Streams?
In Unix and Unix-like operating systems, as well as certain
programming language interfaces, the standard streams are
pre-connected input and output channels between a
computer program and its environment (typically a text
terminal) when it begins execution. The three I/O
connections are called standard input, standard output and
standard error.
Streams?
In Unix and Unix-like operating systems, as well as certain
programming language interfaces, the standard streams are
pre-connected input and output channels between a
computer program and its environment (typically a text
terminal) when it begins execution. The three I/O
connections are called standard input, standard output and
standard error.
Prompts

Implementation
Prompts

Implementation
Prompts

Implementation
Resources


✤   Capistrano Wiki: - http://www.capify.org/

✤   Bash Hackers Wiki: - http://bash-hackers.org/wiki/

✤   Questions: - lee.hambley@gmail.com

✤   Support: - irc://freenode.org/capistrano

✤   Mailing List: - http://groups.google.com/group/capistrano


                                                                10
Questions?

Más contenido relacionado

La actualidad más candente

LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1Hajime Tazaki
 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Hajime Tazaki
 
Real-time streams and logs with Storm and Kafka
Real-time streams and logs with Storm and KafkaReal-time streams and logs with Storm and Kafka
Real-time streams and logs with Storm and KafkaAndrew Montalenti
 
streamparse and pystorm: simple reliable parallel processing with storm
streamparse and pystorm: simple reliable parallel processing with stormstreamparse and pystorm: simple reliable parallel processing with storm
streamparse and pystorm: simple reliable parallel processing with stormDaniel Blanchard
 
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesCS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesWei Tsang Ooi
 
Direct Code Execution @ CoNEXT 2013
Direct Code Execution @ CoNEXT 2013Direct Code Execution @ CoNEXT 2013
Direct Code Execution @ CoNEXT 2013Hajime Tazaki
 
Training Slides: 104 - Basics - Working With Command Line Tools
Training Slides: 104 - Basics - Working With Command Line ToolsTraining Slides: 104 - Basics - Working With Command Line Tools
Training Slides: 104 - Basics - Working With Command Line ToolsContinuent
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioHajime Tazaki
 
Instrumenting parsecs raytrace
Instrumenting parsecs raytraceInstrumenting parsecs raytrace
Instrumenting parsecs raytraceMário Almeida
 
Zeromq anatomy & jeromq
Zeromq anatomy & jeromqZeromq anatomy & jeromq
Zeromq anatomy & jeromqDongmin Yu
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)Sam Kim
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory AnalysisMoabi.com
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConJérôme Petazzoni
 
[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler CollectionMoabi.com
 

La actualidad más candente (20)

LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 
Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014Direct Code Execution - LinuxCon Japan 2014
Direct Code Execution - LinuxCon Japan 2014
 
Real-time streams and logs with Storm and Kafka
Real-time streams and logs with Storm and KafkaReal-time streams and logs with Storm and Kafka
Real-time streams and logs with Storm and Kafka
 
streamparse and pystorm: simple reliable parallel processing with storm
streamparse and pystorm: simple reliable parallel processing with stormstreamparse and pystorm: simple reliable parallel processing with storm
streamparse and pystorm: simple reliable parallel processing with storm
 
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked GamesCS4344 09/10 Lecture 10: Transport Protocol for Networked Games
CS4344 09/10 Lecture 10: Transport Protocol for Networked Games
 
Direct Code Execution @ CoNEXT 2013
Direct Code Execution @ CoNEXT 2013Direct Code Execution @ CoNEXT 2013
Direct Code Execution @ CoNEXT 2013
 
.ppt
.ppt.ppt
.ppt
 
Storm
StormStorm
Storm
 
Training Slides: 104 - Basics - Working With Command Line Tools
Training Slides: 104 - Basics - Working With Command Line ToolsTraining Slides: 104 - Basics - Working With Command Line Tools
Training Slides: 104 - Basics - Working With Command Line Tools
 
NUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osioNUSE (Network Stack in Userspace) at #osio
NUSE (Network Stack in Userspace) at #osio
 
mTCP使ってみた
mTCP使ってみたmTCP使ってみた
mTCP使ってみた
 
Instrumenting parsecs raytrace
Instrumenting parsecs raytraceInstrumenting parsecs raytrace
Instrumenting parsecs raytrace
 
Zeromq anatomy & jeromq
Zeromq anatomy & jeromqZeromq anatomy & jeromq
Zeromq anatomy & jeromq
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
 
[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection
 
Backtrack Manual Part6
Backtrack Manual Part6Backtrack Manual Part6
Backtrack Manual Part6
 
Open Source Debugging v1.3.2
Open Source Debugging v1.3.2Open Source Debugging v1.3.2
Open Source Debugging v1.3.2
 
Kernel
KernelKernel
Kernel
 

Similar a Intermediate Capistrano

Open stack day 2014 havana from grizzly
Open stack day 2014 havana from grizzlyOpen stack day 2014 havana from grizzly
Open stack day 2014 havana from grizzlyChoe Cheng-Dae
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesTrowalts
 
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
Positive Hack Days. Pavlov. Network Infrastructure Security AssessmentPositive Hack Days. Pavlov. Network Infrastructure Security Assessment
Positive Hack Days. Pavlov. Network Infrastructure Security AssessmentPositive Hack Days
 
Deep Dive on Amazon EC2 Instances (March 2017)
Deep Dive on Amazon EC2 Instances (March 2017)Deep Dive on Amazon EC2 Instances (March 2017)
Deep Dive on Amazon EC2 Instances (March 2017)Julien SIMON
 
How Yelp does Service Discovery
How Yelp does Service DiscoveryHow Yelp does Service Discovery
How Yelp does Service DiscoveryJohn Billings
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value StoreSantal Li
 
Distribute key value_store
Distribute key value_storeDistribute key value_store
Distribute key value_storedrewz lin
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and ChefDavid Benjamin
 
NSClient Workshop: 04 Protocols
NSClient Workshop: 04 ProtocolsNSClient Workshop: 04 Protocols
NSClient Workshop: 04 ProtocolsMichael Medin
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilionAkihiro Suda
 
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]Chris Suszyński
 
Loadbalancing In-depth study for scale @ 80K TPS
Loadbalancing In-depth study for scale @ 80K TPS Loadbalancing In-depth study for scale @ 80K TPS
Loadbalancing In-depth study for scale @ 80K TPS Shrey Agarwal
 
Infinispan @ JBUG Milano
Infinispan @ JBUG MilanoInfinispan @ JBUG Milano
Infinispan @ JBUG Milanotristantarrant
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridJBug Italy
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierCarlos Sanchez
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the wayOleg Podsechin
 

Similar a Intermediate Capistrano (20)

Open stack day 2014 havana from grizzly
Open stack day 2014 havana from grizzlyOpen stack day 2014 havana from grizzly
Open stack day 2014 havana from grizzly
 
Architecture
ArchitectureArchitecture
Architecture
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and Ponies
 
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
Positive Hack Days. Pavlov. Network Infrastructure Security AssessmentPositive Hack Days. Pavlov. Network Infrastructure Security Assessment
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
 
Deep Dive on Amazon EC2 Instances (March 2017)
Deep Dive on Amazon EC2 Instances (March 2017)Deep Dive on Amazon EC2 Instances (March 2017)
Deep Dive on Amazon EC2 Instances (March 2017)
 
How Yelp does Service Discovery
How Yelp does Service DiscoveryHow Yelp does Service Discovery
How Yelp does Service Discovery
 
Distribute Key Value Store
Distribute Key Value StoreDistribute Key Value Store
Distribute Key Value Store
 
Distribute key value_store
Distribute key value_storeDistribute key value_store
Distribute key value_store
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
 
IPS_3M_eng
IPS_3M_engIPS_3M_eng
IPS_3M_eng
 
Apache samza
Apache samzaApache samza
Apache samza
 
Backtrack Manual Part8
Backtrack Manual Part8Backtrack Manual Part8
Backtrack Manual Part8
 
NSClient Workshop: 04 Protocols
NSClient Workshop: 04 ProtocolsNSClient Workshop: 04 Protocols
NSClient Workshop: 04 Protocols
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion
 
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
You need Event Mesh, not Service Mesh - Chris Suszynski [WJUG 301]
 
Loadbalancing In-depth study for scale @ 80K TPS
Loadbalancing In-depth study for scale @ 80K TPS Loadbalancing In-depth study for scale @ 80K TPS
Loadbalancing In-depth study for scale @ 80K TPS
 
Infinispan @ JBUG Milano
Infinispan @ JBUG MilanoInfinispan @ JBUG Milano
Infinispan @ JBUG Milano
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data Grid
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the way
 

Último

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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...Neo4j
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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 interpreternaman860154
 
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 MenDelhi Call girls
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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 MenDelhi Call girls
 
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...Miguel Araújo
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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...Martijn de Jong
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Intermediate Capistrano

  • 1. Capistrano at your command Tips and tricks, from wimp to winner Lee Hambley - August 20th 2009 1
  • 2. What’s on the menu? ✤ Capistrano’s Structure ✤ Net::SSH ✤ The Scope of Execution ✤ Task chaining; your own multi-stage ✤ Streams ✤ Prompts 2
  • 3. Simply put, Capistrano is a tool for automating tasks on one or more remote servers. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back Capistrano changes across multiple machines. It is ideal for anyone doing any kind of system administration, either professionally or incidentally. What’s in the Box? Net::SSH Net::SFTP Net::SCP Net::SSH::Gateway $ gem dependency capistrano Gem capistrano-2.5.8 Capistrano’s Structure net-ssh (>= 2.0.10, runtime) net-sftp (>= 2.0.0, runtime) net-scp (>= 1.0.0, runtime) net-ssh-gateway (>= 1.0.0, runtime) 3
  • 4. Simply put, Capistrano is a tool for automating tasks on one or more remote servers. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back Capistrano changes across multiple machines. It is ideal for anyone doing any kind of system administration, either professionally or incidentally. What’s in the Box? ✤ Consistent support for different source control software. Net::SSH Net::SFTP Net::SCP Net::SSH::Gateway $ gem dependency capistrano Gem capistrano-2.5.8 Capistrano’s Structure net-ssh (>= 2.0.10, runtime) net-sftp (>= 2.0.0, runtime) net-scp (>= 1.0.0, runtime) net-ssh-gateway (>= 1.0.0, runtime) 3
  • 5. Simply put, Capistrano is a tool for automating tasks on one or more remote servers. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back Capistrano changes across multiple machines. It is ideal for anyone doing any kind of system administration, either professionally or incidentally. What’s in the Box? ✤ Consistent support for different source control software. Net::SSH Net::SFTP Net::SCP ✤ Rake-esque task definitions, including before/after callbacks for method chaining. Net::SSH::Gateway $ gem dependency capistrano Gem capistrano-2.5.8 Capistrano’s Structure net-ssh (>= 2.0.10, runtime) net-sftp (>= 2.0.0, runtime) net-scp (>= 1.0.0, runtime) net-ssh-gateway (>= 1.0.0, runtime) 3
  • 6. Simply put, Capistrano is a tool for automating tasks on one or more remote servers. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back Capistrano changes across multiple machines. It is ideal for anyone doing any kind of system administration, either professionally or incidentally. What’s in the Box? ✤ Consistent support for different source control software. Net::SSH Net::SFTP Net::SCP ✤ Rake-esque task definitions, including before/after callbacks for method chaining. Net::SSH::Gateway ✤ Ability to detect and rollback broken jobs using transactions $ gem dependency capistrano Gem capistrano-2.5.8 Capistrano’s Structure net-ssh (>= 2.0.10, runtime) net-sftp (>= 2.0.0, runtime) net-scp (>= 1.0.0, runtime) net-ssh-gateway (>= 1.0.0, runtime) 3
  • 7. Simply put, Capistrano is a tool for automating tasks on one or more remote servers. It executes commands in parallel on all targeted machines, and provides a mechanism for rolling back Capistrano changes across multiple machines. It is ideal for anyone doing any kind of system administration, either professionally or incidentally. What’s in the Box? ✤ Consistent support for different source control software. Net::SSH Net::SFTP Net::SCP ✤ Rake-esque task definitions, including before/after callbacks for method chaining. Net::SSH::Gateway ✤ Ability to detect and rollback broken jobs using transactions ✤ Roles, :app, :web, :db & :define-your-own $ gem dependency capistrano Gem capistrano-2.5.8 Capistrano’s Structure net-ssh (>= 2.0.10, runtime) net-sftp (>= 2.0.0, runtime) net-scp (>= 1.0.0, runtime) net-ssh-gateway (>= 1.0.0, runtime) 3
  • 8. Net::SSH ✤ Magical pure-Ruby implementation of the SSH protocol. ✤ Honours your ~/ssh/config settings. ✤ Supports (creating and using) Tunnels, Gateways, Agent Forwarding and more... ✤ Super clean syntax...
  • 9. Net::SSH ✤ Magical pure-Ruby implementation of the SSH protocol. ✤ Honours your ~/ssh/config settings. ✤ Supports (creating and using) Tunnels, Gateways, Agent Forwarding and more... ✤ Super clean syntax...
  • 10. Net::SSH ✤ Magical pure-Ruby implementation of the SSH protocol. ✤ Honours your ~/ssh/config settings. ✤ Supports (creating and using) Tunnels, Gateways, Agent Forwarding and more... ✤ Super clean syntax...
  • 11. The Scope of Execution ✤ What runs where? ✤ What permissions will I need? ✤ Obscure errors about permissions? ✤ .. lots of different things happening
  • 12. The Scope of Execution $ → cap deploy Calling another Capistrano task. * executing `deploy' * executing `deploy:update' Transactions, you can define what to do for your own transactions if a task within it fails. ** transaction: start { * executing `deploy:update_code' A shell command run on your workstation. executing locally: "git ls-remote git@github.com:leehambley/ capistrano-website.git HEAD" A shell command run remotely. * executing "git clone -q git@github.com:leehambley/capistrano- website.git /u/apps/capistrano-website/releases/20090820114515 && ...... " { * executing `deploy:finalize_update' A shell command run remotely, connecting to your repository server. † * executing "chmod -R g+w /u/apps/capistrano-website/releases/ 20090820114515" { * executing `deploy:symlink' * executing "rm -f /u/apps/capistrano-website/current && ln -s /u/apps/ capistrano-website/releases/20090820114515 /u/apps/capistrano-website/ current" ** transaction: commit † Requires passwordless access to your repository server from your servers; this can be either keys (GitHub deploy keys feature) or SSH agent forwarding to provide your own key by proxy
  • 13. Task Chaining ➊ ➋ ➌ $ rake db:migrate spec features
  • 14. Task Chaining ➊ ➋ ➌ $ rake db:migrate spec features ➊ ➋ $ cap check-ruby-version deploy
  • 15. Task Chaining ➊ ➋ ➌ $ rake db:migrate spec features ----------------- ➊ ➋ $ cap check-ruby-version deploy
  • 16. Task Chaining ➊ ➋ ➌ $ rake db:migrate spec features ----------------- ➊ ➋ $ cap check-ruby-version deploy capture Executes a command on a single host and returns ("captures") the output as a string. stream Very similar to run, but optimised for displaying live streams of text (like tailed log files) from multiple hosts. run Execute commands on one or more servers
  • 17. Task Chaining ➊ ➋ ➌ $ rake db:migrate spec features ----------------- ➊ ➋ $ cap check-ruby-version deploy ➊ ➋ ➌ $ cap staging check-ruby-version deploy capture Executes a command on a single host and returns ("captures") the output as a string. stream Very similar to run, but optimised for displaying live streams of text (like tailed log files) from multiple hosts. run Execute commands on one or more servers
  • 18. Task Chaining ➊ ➋ ➌ $ rake db:migrate spec features ----------------- ➊ ➋ $ cap check-ruby-version deploy ➊ ➋ ➌ $ cap staging check-ruby-version deploy capture Executes a command on a single host and returns ("captures") the output as a string. stream Very similar to run, but optimised for displaying live streams of text (like tailed log files) from multiple hosts. run Execute commands on one or more servers
  • 19. Streams? In Unix and Unix-like operating systems, as well as certain programming language interfaces, the standard streams are pre-connected input and output channels between a computer program and its environment (typically a text terminal) when it begins execution. The three I/O connections are called standard input, standard output and standard error.
  • 20. Streams? In Unix and Unix-like operating systems, as well as certain programming language interfaces, the standard streams are pre-connected input and output channels between a computer program and its environment (typically a text terminal) when it begins execution. The three I/O connections are called standard input, standard output and standard error.
  • 21. Streams? In Unix and Unix-like operating systems, as well as certain programming language interfaces, the standard streams are pre-connected input and output channels between a computer program and its environment (typically a text terminal) when it begins execution. The three I/O connections are called standard input, standard output and standard error.
  • 25. Resources ✤ Capistrano Wiki: - http://www.capify.org/ ✤ Bash Hackers Wiki: - http://bash-hackers.org/wiki/ ✤ Questions: - lee.hambley@gmail.com ✤ Support: - irc://freenode.org/capistrano ✤ Mailing List: - http://groups.google.com/group/capistrano 10