Capistrano is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
tool for running scripts on multiple servers; its main use is deploying
web application
A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection.
History
In earlier computing models like client-serve ...
s. It automates the process of making a new version of an application available on one or more
web server
A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initi ...
s, including supporting tasks such as changing databases.
Capistrano is written in the
Ruby language
Ruby is an interpreted, high-level, general-purpose programming language which supports multiple programming paradigms. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including p ...
and is distributed using the
RubyGems
RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gem ...
distribution channel. It is an outgrowth of the
Ruby on Rails
Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and web ...
web application framework, but it is also used to deploy web applications written using other languages, for example,
PHP
PHP is a General-purpose programming language, general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementati ...
.
Capistrano is implemented primarily for use on the
UNIX shell
A Unix shell is a command-line interpreter or shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and is used by the operating system t ...
command line. A user may choose from many Capistrano recipes, e.g. to deploy current changes to the web application or roll back to the previous deployment state.
Originally called SwitchTower, the name was changed to Capistrano in March 2006 due to a trademark conflict. The original author, Jamis Buck, announced on February 24, 2009 that he is no longer the maintainer of the project.
Internals
Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH. It uses a simple
domain-specific language borrowed in part from the tool
Rake. It also supports tunnelling connections via some gateway machine to allow operations to be performed behind VPNs and firewalls.
Capistrano was originally designed to simplify and automate deployment of web applications to distributed environments, and originally came bundled with a set of tasks designed for deploying Ruby on Rails applications. The deployment tasks are now (as of Capistrano 2.0) opt-in and require clients to explicitly put "load 'deploy'" in their recipes.
Example Capfile
task :xml_libs, :hosts => "www.capify.org" do
run "ls -x1 /usr/lib , grep -i xml"
end
This defines a single task, called "xml_libs", and says that it should be executed only on the "www.capify.org" host. When executed, it will display all files and subdirectories in /usr/lib that include the text "xml" in their name. Assuming the capfile is in the current directory, the user would execute that task like this:
cap xml_libs
See also
*
Ansible
An ansible is a category of fictional devices or technology capable of near-instantaneous or faster-than-light communication. It can send and receive messages to and from a corresponding device over any distance or obstacle whatsoever with no de ...
*
Chef
A chef is a trained professional cook and tradesman who is proficient in all aspects of food preparation, often focusing on a particular cuisine. The word "chef" is derived from the term ''chef de cuisine'' (), the director or head of a k ...
*
Harrow
Harrow may refer to:
Places
* Harrow, Victoria, Australia
* Harrow, Ontario, Canada
* The Harrow, County Wexford, a village in Ireland
* London Borough of Harrow, England
** Harrow, London, a town in London
** Harrow (UK Parliament constituency)
...
*
Salt
Salt is a mineral composed primarily of sodium chloride (NaCl), a chemical compound belonging to the larger class of salts; salt in the form of a natural crystalline mineral is known as rock salt or halite. Salt is present in vast quanti ...
*
Puppet
A puppet is an object, often resembling a human, animal or Legendary creature, mythical figure, that is animated or manipulated by a person called a puppeteer. The puppeteer uses movements of their hands, arms, or control devices such as rods ...
*
Tsshbatch
*
Comparison of open source configuration management software
References
Further reading
*
External links
*
deprec project: Deployment Recipes for capistranoCapistrano ChangelogFabric, a similar system written in Pythontsshbatch, another similar system written in Python
{{Ruby programming language
Configuration management
Free software programmed in Ruby
Ruby (programming language)
Web applications
Software using the MIT license