SlideShare a Scribd company logo
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?

More Related Content

What's hot

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
Hajime 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 Kafka
Andrew 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 storm
Daniel 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 2013
Hajime Tazaki
 
Storm
StormStorm
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
Continuent
 
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
Hajime Tazaki
 
Instrumenting parsecs raytrace
Instrumenting parsecs raytraceInstrumenting parsecs raytrace
Instrumenting parsecs raytrace
Mário Almeida
 
Zeromq anatomy & jeromq
Zeromq anatomy & jeromqZeromq anatomy & jeromq
Zeromq anatomy & jeromq
Dongmin 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 Analysis
Moabi.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 - LinuxCon
Jé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 Collection
Moabi.com
 
Backtrack Manual Part6
Backtrack Manual Part6Backtrack Manual Part6
Backtrack Manual Part6
Nutan Kumar Panda
 
Open Source Debugging v1.3.2
Open Source Debugging v1.3.2Open Source Debugging v1.3.2
Open Source Debugging v1.3.2
Matthew McCullough
 

What's hot (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 to 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 Ponies
Trowalts
 
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
Positive 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 Discovery
John 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 Chef
David Benjamin
 
Apache samza
Apache samzaApache samza
Apache samza
Humberto Streb
 
Backtrack Manual Part8
Backtrack Manual Part8Backtrack Manual Part8
Backtrack Manual Part8
Nutan Kumar Panda
 
NSClient Workshop: 04 Protocols
NSClient Workshop: 04 ProtocolsNSClient Workshop: 04 Protocols
NSClient Workshop: 04 Protocols
Michael Medin
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion
Akihiro 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 Milano
tristantarrant
 
Infinispan and Enterprise Data Grid
Infinispan and Enterprise Data GridInfinispan and Enterprise Data Grid
Infinispan and Enterprise Data Grid
JBug Italy
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
Carlos 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 way
Oleg Podsechin
 

Similar to 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
 

Recently uploaded

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

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