SlideShare uma empresa 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?

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Semelhante 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
 

Semelhante 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

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 

Último (20)

Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 

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