1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Adding SSHKit to documentation, and a bit...

* Added SSHKit example page
* Added a note about .cap files in lib/capistrano/tasks.
* Removed "debugger" from Gemfile
* Updated SSHKit github link
* Fixed a HTML
* Rebuilt content with jekyll build
This commit is contained in:
Matt Connolly 2014-01-02 10:00:35 +10:00
parent 463d638007
commit 5f715fa05c
29 changed files with 653 additions and 79 deletions

View file

@ -1,6 +1,5 @@
source "https://rubygems.org"
gem "debugger"
gem "jekyll", "~> 1.1.2"
gem "redcarpet"
gem "unindent"

View file

@ -4,15 +4,8 @@ GEM
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
colorator (0.1)
columnize (0.3.6)
commander (4.1.3)
highline (~> 1.6.11)
debugger (1.6.1)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.2.3)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.3)
directory_watcher (1.4.1)
fast-stemmer (1.0.2)
git (1.2.5)
@ -56,7 +49,6 @@ PLATFORMS
ruby
DEPENDENCIES
debugger
git
jekyll (~> 1.1.2)
redcarpet

View file

@ -9,12 +9,13 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -1294,8 +1296,8 @@ piecemeal with their own implementations</p>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -1,6 +1,6 @@
source "https://rubygems.org"
gem "debugger"
#gem "debugger"
gem "jekyll", "~> 1.1.2"
gem "redcarpet"
gem "unindent"

View file

@ -4,15 +4,8 @@ GEM
classifier (1.3.3)
fast-stemmer (>= 1.0.0)
colorator (0.1)
columnize (0.3.6)
commander (4.1.3)
highline (~> 1.6.11)
debugger (1.6.1)
columnize (>= 0.3.1)
debugger-linecache (~> 1.2.0)
debugger-ruby_core_source (~> 1.2.3)
debugger-linecache (1.2.0)
debugger-ruby_core_source (1.2.3)
directory_watcher (1.4.1)
fast-stemmer (1.0.2)
git (1.2.5)
@ -56,7 +49,6 @@ PLATFORMS
ruby
DEPENDENCIES
debugger
git
jekyll (~> 1.1.2)
redcarpet

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -134,8 +136,8 @@
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -174,8 +176,8 @@ Capistrano::Application.invoke(&quot;deploy&quot;)</code></pre>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -0,0 +1,293 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Host filtering</title>
<link href='http://fonts.googleapis.com/css?family=Enriqueta' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="//use.typekit.net/itm5ubu.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<link rel="stylesheet" href="/css/foundation.css" />
<link rel="stylesheet" href="/css/capistrano.css">
<link rel="stylesheet" href="/css/social_foundicons.css" />
<link rel="stylesheet" href="/css/okaidia.css">
<script src="/js/vendor/custom.modernizr.js"></script>
</head>
<body>
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '51c83c32613f5d7df70000bc');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
<script type="text/javascript">
setTimeout(function(){var a=document.createElement("script");
var b=document.getElementsByTagName("script")[0];
a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0017/6418.js?"+Math.floor(new Date().getTime()/3600000);
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41970098-1', 'capistranorb.com');
ga('send', 'pageview');
</script>
<div class="header">
<div class="row">
<div class="large-12 column">
<a href="/" class="brand">
<img src="/images/CapistranoLogo.png" />
</a>
</div>
</div>
</div>
<div class="row">
<div class="large-4 columns">
<ul class="side-nav">
<li><a href="https://www.harrow.io/" class="advertisment"><span class="label label-important">New</span> Hosted Capistrano for Teams</a></li>
<li class="divider"></li>
<h5>Overview</h5>
<li><a href="/documentation/overview/what-is-capistrano/">What is Capistrano?</a></li>
<!--<li><a href="/documentation/overview/introductory-demo-video/">Introductory Demo Video</a></li>-->
<li class="divider"></li>
<h5>Getting Started</h5>
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>
<li><a href="/documentation/frameworks/bundler/">Bundler</a></li>
<li><a href="/documentation/frameworks/rbenv-rvm-chruby/">Rbenv &amp; RVM &amp; chruby</a></li>
<!--<li class="divider"></li> -->
<!--<h5>Troubleshooting</h5> -->
<!--<li><a href="/documentation/troubleshooting/authentication/">SCM (Git) Authentication</a></li>-->
<!--<li><a href="/documentation/troubleshooting/connectivity/">Connectivity</a></li> -->
<!--[><li><a href="/documentation/troubleshooting/gateway-servers/">Gateway Servers</a></li><] -->
<!--<li><a href="/documentation/troubleshooting/agent-forwarding/">Agent Forwarding</a></li> -->
<!--<li><a href="/documentation/troubleshooting/sudo-password/">`sudo` Password</a></li> -->
<!--<li><a href="/documentation/troubleshooting/rvm-rbenv-nvm/">RVM, `rbenv` And `nvm`</a></li> -->
<li class="divider"></li>
<h5>FAQ</h5>
<li><a href="/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/">Why Does Something Work In An SSH Session, But Not In Capistrano?</a></li>
<!--<li><a href="/documentation/faq/should-i-use-capistrano-to-provision-my-servers/">Should I Use Capistrano To Provision My Servers?</a></li>-->
<li><a href="http://lee.hambley.name/2013/06/11/using-capistrano-v3-with-chef.html">Should I Use Capistrano To Provision My Servers?</a></li>
<!--<li class="divider"></li> -->
<!--<h5>Power Use-Cases</h5> -->
<!--<li><a href="/documentation/power-use-cases/integration-with-rake/">Integration With Rake</a></li> -->
<!--<li><a href="/documentation/power-use-cases/driving-tools-such-as-chef-solo/">Driving Tools Such As <em>Chef Solo</em></a></li>-->
<li class="divider"></li>
<h5>Legacy Documentation</h5>
<li><a href="https://github.com/capistrano/capistrano/wiki">Capistrano
v2</a></li>
<li class="divider"></li>
<h5>Recent Announcements</h5>
<li><a href="/2013/06/01/release-announcement.html"><span class="post-date">01 Jun 2013</span> Capistrano Version 3 Release Announcement</a></li>
</ul>
</div>
<div class="large-8 column">
<div class="content">
<h2>Host filtering</h2>
<p>You may encounter situations where you only want to deploy to a subset of
the servers defined in your configuration. For example, a single server or
set of servers may be misbehaving, and you want to re-deploy to just these
servers without deploying to every server.</p>
<p>You can use the <em>host filter</em> to restrict Capistrano tasks to only servers
that match a given set of hostnames.</p>
<p>If the filter matches no servers, no actions will be taken.</p>
<p>If you specify a filter, it will match servers that have the listed hostnames,
and it will run <em>all</em> the roles for each server. In other words, it only affects
the servers the task runs on, not what tasks are run on a server. </p>
<p>You can limit by role and by host; if you do this, the role filtering will
apply first. For example, lets say you filtered by the role <code>app</code>, then by
the hostnames <code>server1</code> and <code>server2</code>. Capistrano would first filter the
available servers to only those with the role <code>app</code>, then filter them
to look for servers with the hostname <code>server1</code> or <code>server2</code>. If only <code>server2</code>
had the role <code>app</code> (<code>server1</code> has some other role), then in this situation your
task would only run on <code>server2</code>.</p>
<h3 id="toc_0">Specifying a host filter</h3>
<p>There are three ways to specify the host filter.</p>
<h4 id="toc_1">Environment variable</h4>
<p>Capistrano will read the host filter from the environment variable <code>HOSTS</code>
if it is set. You can set it inline:</p>
<div>
<pre data-line=''><code class='language-bash'>HOSTS=server1,server2 cap production deploy</code></pre>
</div>
<p>Specify multiple hosts by separating them with a comma.</p>
<h4 id="toc_2">In configuration</h4>
<p>You can set the host filter inside your deploy configuration. For example,
you can set the following inside <code>config/deploy.rb</code>:</p>
<div>
<pre data-line=''><code class='language-ruby'>set :filter, :hosts =&gt; %w{server1 server2}</code></pre>
</div>
<p>Note that you specify the filter as an array rather than as a comma-separated
list of servers when using this method.</p>
<h4 id="toc_3">On the command line</h4>
<p>In a similar way to using the environment variable, you can set the role
filter by specifying it as a command line argument to <code>cap</code>:</p>
<div>
<pre data-line=''><code class='language-bash'>cap --hosts=server1,server2 production deploy</code></pre>
</div>
<p>Like the environment variable method, specify multiple servers by separating
them with a comma.</p>
</div>
</div>
</div>
<!--<div class="container"> -->
<!-- <h1 class="title"><a href="/">Capistrano</a></h1>-->
<!-- <a class="extra" href="/">home</a> -->
<!-- </div> -->
<!-- <p>You may encounter situations where you only want to deploy to a subset of
the servers defined in your configuration. For example, a single server or
set of servers may be misbehaving, and you want to re-deploy to just these
servers without deploying to every server.</p>
<p>You can use the <em>host filter</em> to restrict Capistrano tasks to only servers
that match a given set of hostnames.</p>
<p>If the filter matches no servers, no actions will be taken.</p>
<p>If you specify a filter, it will match servers that have the listed hostnames,
and it will run <em>all</em> the roles for each server. In other words, it only affects
the servers the task runs on, not what tasks are run on a server. </p>
<p>You can limit by role and by host; if you do this, the role filtering will
apply first. For example, lets say you filtered by the role <code>app</code>, then by
the hostnames <code>server1</code> and <code>server2</code>. Capistrano would first filter the
available servers to only those with the role <code>app</code>, then filter them
to look for servers with the hostname <code>server1</code> or <code>server2</code>. If only <code>server2</code>
had the role <code>app</code> (<code>server1</code> has some other role), then in this situation your
task would only run on <code>server2</code>.</p>
<h3 id="toc_0">Specifying a host filter</h3>
<p>There are three ways to specify the host filter.</p>
<h4 id="toc_1">Environment variable</h4>
<p>Capistrano will read the host filter from the environment variable <code>HOSTS</code>
if it is set. You can set it inline:</p>
<div>
<pre data-line=''><code class='language-bash'>HOSTS=server1,server2 cap production deploy</code></pre>
</div>
<p>Specify multiple hosts by separating them with a comma.</p>
<h4 id="toc_2">In configuration</h4>
<p>You can set the host filter inside your deploy configuration. For example,
you can set the following inside <code>config/deploy.rb</code>:</p>
<div>
<pre data-line=''><code class='language-ruby'>set :filter, :hosts =&gt; %w{server1 server2}</code></pre>
</div>
<p>Note that you specify the filter as an array rather than as a comma-separated
list of servers when using this method.</p>
<h4 id="toc_3">On the command line</h4>
<p>In a similar way to using the environment variable, you can set the role
filter by specifying it as a command line argument to <code>cap</code>:</p>
<div>
<pre data-line=''><code class='language-bash'>cap --hosts=server1,server2 production deploy</code></pre>
</div>
<p>Like the environment variable method, specify multiple servers by separating
them with a comma.</p>
-->
<!--</div> [> /container <] -->
<footer>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>
<div class="large-4 columns">
<ul>
<li><a href="http://stackoverflow.com/questions/tagged/capistrano">StackOverflow</a></li>
<li><a href="https://groups.google.com/forum/#!forum/capistrano">Mailing List</a></li>
</ul>
</div>
<div class="large-4 columns">
<ul class="social icons">
<li><a href="//twitter.com/capistranorb"><i class="foundicon-twitter"></i></a></li>
<li><a href="//github.com/capistrano"><i class="foundicon-github"></i></a></li>
</ul>
</div>
</div>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>
if (!window.jQuery) {
document.write('<script src="/js/jquery-1.7.min"><\/script>');
}
</script>
<script src="/js/jquery.githubRepoWidget.min.js"></script>
<script src="/js/prism.js"></script>
<script src="/js/prism.ruby.js"></script>
<a href="https://github.com/capistrano/documentation"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
</body>
</html>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -170,8 +172,8 @@ end</code></pre>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -240,8 +242,8 @@ with a comma.</p>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -0,0 +1,223 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Remote commands with SSH Kit</title>
<link href='http://fonts.googleapis.com/css?family=Enriqueta' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="//use.typekit.net/itm5ubu.js"></script>
<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
<link rel="stylesheet" href="/css/foundation.css" />
<link rel="stylesheet" href="/css/capistrano.css">
<link rel="stylesheet" href="/css/social_foundicons.css" />
<link rel="stylesheet" href="/css/okaidia.css">
<script src="/js/vendor/custom.modernizr.js"></script>
</head>
<body>
<script type="text/javascript">
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
t.type = 'text/javascript';
t.async = true;
t.id = 'gauges-tracker';
t.setAttribute('data-site-id', '51c83c32613f5d7df70000bc');
t.src = '//secure.gaug.es/track.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
<script type="text/javascript">
setTimeout(function(){var a=document.createElement("script");
var b=document.getElementsByTagName("script")[0];
a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0017/6418.js?"+Math.floor(new Date().getTime()/3600000);
a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 1);
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41970098-1', 'capistranorb.com');
ga('send', 'pageview');
</script>
<div class="header">
<div class="row">
<div class="large-12 column">
<a href="/" class="brand">
<img src="/images/CapistranoLogo.png" />
</a>
</div>
</div>
</div>
<div class="row">
<div class="large-4 columns">
<ul class="side-nav">
<li><a href="https://www.harrow.io/" class="advertisment"><span class="label label-important">New</span> Hosted Capistrano for Teams</a></li>
<li class="divider"></li>
<h5>Overview</h5>
<li><a href="/documentation/overview/what-is-capistrano/">What is Capistrano?</a></li>
<!--<li><a href="/documentation/overview/introductory-demo-video/">Introductory Demo Video</a></li>-->
<li class="divider"></li>
<h5>Getting Started</h5>
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>
<li><a href="/documentation/frameworks/bundler/">Bundler</a></li>
<li><a href="/documentation/frameworks/rbenv-rvm-chruby/">Rbenv &amp; RVM &amp; chruby</a></li>
<!--<li class="divider"></li> -->
<!--<h5>Troubleshooting</h5> -->
<!--<li><a href="/documentation/troubleshooting/authentication/">SCM (Git) Authentication</a></li>-->
<!--<li><a href="/documentation/troubleshooting/connectivity/">Connectivity</a></li> -->
<!--[><li><a href="/documentation/troubleshooting/gateway-servers/">Gateway Servers</a></li><] -->
<!--<li><a href="/documentation/troubleshooting/agent-forwarding/">Agent Forwarding</a></li> -->
<!--<li><a href="/documentation/troubleshooting/sudo-password/">`sudo` Password</a></li> -->
<!--<li><a href="/documentation/troubleshooting/rvm-rbenv-nvm/">RVM, `rbenv` And `nvm`</a></li> -->
<li class="divider"></li>
<h5>FAQ</h5>
<li><a href="/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/">Why Does Something Work In An SSH Session, But Not In Capistrano?</a></li>
<!--<li><a href="/documentation/faq/should-i-use-capistrano-to-provision-my-servers/">Should I Use Capistrano To Provision My Servers?</a></li>-->
<li><a href="http://lee.hambley.name/2013/06/11/using-capistrano-v3-with-chef.html">Should I Use Capistrano To Provision My Servers?</a></li>
<!--<li class="divider"></li> -->
<!--<h5>Power Use-Cases</h5> -->
<!--<li><a href="/documentation/power-use-cases/integration-with-rake/">Integration With Rake</a></li> -->
<!--<li><a href="/documentation/power-use-cases/driving-tools-such-as-chef-solo/">Driving Tools Such As <em>Chef Solo</em></a></li>-->
<li class="divider"></li>
<h5>Legacy Documentation</h5>
<li><a href="https://github.com/capistrano/capistrano/wiki">Capistrano
v2</a></li>
<li class="divider"></li>
<h5>Recent Announcements</h5>
<li><a href="/2013/06/01/release-announcement.html"><span class="post-date">01 Jun 2013</span> Capistrano Version 3 Release Announcement</a></li>
</ul>
</div>
<div class="large-8 column">
<div class="content">
<h2>Remote commands with SSH Kit</h2>
<p>Capistrano executes commands on remote servers using <a href="https://github.com/capistrano/sshkit"><strong>SSHKit</strong></a>.</p>
<p>An example setting a working directory, user and environment variable:</p>
<div>
<pre data-line=''><code class='language-ruby'>on roles(:app), in: :sequence, wait: 5 do
within &quot;/opt/sites/example.com&quot; do
# commands in this block execute in the
# directory: /opt/sites/example.com
as :deploy do
# commands in this block execute as the &quot;deploy&quot; user.
with rails_env: :production do
# commands in this block execute with the environment
# variable RAILS_ENV=production
rake &quot;assets:precompile&quot;
runner &quot;S3::Sync.notify&quot;
end
end
end
end</code></pre>
</div>
<p>For more examples, see the EXAMPLES.md file in the <a href="https://github.com/capistrano/sshkit"><strong>SSHKit</strong></a> project:</p>
<p><a href="https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md">https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md</a></p>
</div>
</div>
</div>
<!--<div class="container"> -->
<!-- <h1 class="title"><a href="/">Capistrano</a></h1>-->
<!-- <a class="extra" href="/">home</a> -->
<!-- </div> -->
<!-- <p>Capistrano executes commands on remote servers using <a href="https://github.com/capistrano/sshkit"><strong>SSHKit</strong></a>.</p>
<p>An example setting a working directory, user and environment variable:</p>
<div>
<pre data-line=''><code class='language-ruby'>on roles(:app), in: :sequence, wait: 5 do
within &quot;/opt/sites/example.com&quot; do
# commands in this block execute in the
# directory: /opt/sites/example.com
as :deploy do
# commands in this block execute as the &quot;deploy&quot; user.
with rails_env: :production do
# commands in this block execute with the environment
# variable RAILS_ENV=production
rake &quot;assets:precompile&quot;
runner &quot;S3::Sync.notify&quot;
end
end
end
end</code></pre>
</div>
<p>For more examples, see the EXAMPLES.md file in the <a href="https://github.com/capistrano/sshkit"><strong>SSHKit</strong></a> project:</p>
<p><a href="https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md">https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md</a></p>
-->
<!--</div> [> /container <] -->
<footer>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>
<div class="large-4 columns">
<ul>
<li><a href="http://stackoverflow.com/questions/tagged/capistrano">StackOverflow</a></li>
<li><a href="https://groups.google.com/forum/#!forum/capistrano">Mailing List</a></li>
</ul>
</div>
<div class="large-4 columns">
<ul class="social icons">
<li><a href="//twitter.com/capistranorb"><i class="foundicon-twitter"></i></a></li>
<li><a href="//github.com/capistrano"><i class="foundicon-github"></i></a></li>
</ul>
</div>
</div>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>
if (!window.jQuery) {
document.write('<script src="/js/jquery-1.7.min"><\/script>');
}
</script>
<script src="/js/jquery.githubRepoWidget.min.js"></script>
<script src="/js/prism.js"></script>
<script src="/js/prism.ruby.js"></script>
<a href="https://github.com/capistrano/documentation"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
</body>
</html>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -370,8 +372,8 @@ INFO Not interactive</code></pre>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -142,8 +144,8 @@ You don&#39;t need anything except <code>require &#39;capistrano/bundler&#39;</c
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -160,8 +162,8 @@
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -168,8 +170,8 @@ appropriate times.</p>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -878,8 +880,8 @@ drwxrwsr-x (2775) /var/www/rails3-bootstrap-devise-cancan-demo/shared</code></p
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -178,7 +180,7 @@ writing your own tasks, namely <code>desc()</code>, <code>task()</code>, <code>o
<p>The first two methods, <code>desc()</code> and <code>task()</code> are actually from Rake, the
library that forms the foundation of the Capistrano task system, the other
methods are part of our sub-project
<a href="https://github.com/leehambley/sshkit"><strong>SSHKit</strong></a>. We&#39;ll dive into those more
<a href="https://github.com/capistrano/sshkit"><strong>SSHKit</strong></a>. We&#39;ll dive into those more
later, but add those lines to a file in <code>./lib/capistrano/tasks</code>, call it
something like <code>access_check.cap</code>, and run <code>cap -T</code> from the top directory and
we&#39;ll be able to see the task listed:</p>
@ -398,7 +400,7 @@ writing your own tasks, namely <code>desc()</code>, <code>task()</code>, <code>o
<p>The first two methods, <code>desc()</code> and <code>task()</code> are actually from Rake, the
library that forms the foundation of the Capistrano task system, the other
methods are part of our sub-project
<a href="https://github.com/leehambley/sshkit"><strong>SSHKit</strong></a>. We&#39;ll dive into those more
<a href="https://github.com/capistrano/sshkit"><strong>SSHKit</strong></a>. We&#39;ll dive into those more
later, but add those lines to a file in <code>./lib/capistrano/tasks</code>, call it
something like <code>access_check.cap</code>, and run <code>cap -T</code> from the top directory and
we&#39;ll be able to see the task listed:</p>
@ -554,8 +556,8 @@ DEBUG [f40edfbb] 3419812c9f146d9a84b44bcc2c3caef94da54758 refs/heads/master
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -350,8 +352,8 @@ require &#39;capistrano/rails/assets&#39;</code></pre>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -282,8 +284,8 @@ the risk of accidentally upgrading to <code>v3</code>.
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -180,6 +182,8 @@ $ cap install</code></pre>
└── tasks</code></pre>
</div>
<p>Your new Capfile will automatically any tasks from any *.cap files in lib/capistrano/tasks.</p>
<h3 id="toc_3">4. Configure your server addresses in the generated files.</h3>
<p>We&#39;ll just work with the staging environment here, so you can pretend that
@ -372,6 +376,8 @@ $ cap install</code></pre>
└── tasks</code></pre>
</div>
<p>Your new Capfile will automatically any tasks from any *.cap files in lib/capistrano/tasks.</p>
<h3 id="toc_3">4. Configure your server addresses in the generated files.</h3>
<p>We&#39;ll just work with the staging environment here, so you can pretend that
@ -498,8 +504,8 @@ to authorise Capistrano on our servers yet.</p>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -136,8 +138,8 @@
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -192,8 +194,8 @@ sitting and watching Ruby compile, for example!)</p>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -426,8 +428,8 @@ end</code></pre>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -300,8 +302,8 @@ end</code></pre>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -70,14 +70,16 @@
<li><a href="https://github.com/capistrano/capistrano/blob/master/README.md">The Readme, start here!</a></li>
<li><a href="/documentation/getting-started/installation/">Installation</a></li>
<li><a href="/documentation/getting-started/preparing-your-application/">Preparing Your Application</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication & Authorisation</a></li>
<li><a href="/documentation/getting-started/authentication-and-authorisation/">Authentication &amp; Authorisation</a></li>
<li><a href="/documentation/getting-started/cold-start/">Cold Start</a></li>
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li class="divider"></li>
<h5>Advanced Features</h5>
<li><a href="/documentation/advanced-features/ssh-kit">Remote commands with SSHKit</li>
<li><a href="/documentation/advanced-features/remote-file/">Remote file task</a></li>
<li><a href="/documentation/advanced-features/role-filtering/">Role filtering</a></li>
<li><a href="/documentation/advanced-features/host-filtering/">Host filtering</a></li>
<li><a href="/documentation/advanced-features/capistrano-pure-ruby/">Using Capistrano from pure Ruby</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
@ -194,8 +196,8 @@ extended to support them.</p>
<div class="row">
<div class="large-4 columns">
<ul>
<li><a href="/about">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING">Contributing</a></li>
<li><a href="/documentation/overview/what-is-capistrano/">About Capistrano</a></li>
<li><a href="https://github.com/capistrano/capistrano/blob/master/CONTRIBUTING.md">Contributing</a></li>
<li><a href="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
</ul>
</div>

View file

@ -0,0 +1,30 @@
---
title: Remote commands with SSH Kit
layout: default
---
Capistrano executes commands on remote servers using [**SSHKit**](https://github.com/capistrano/sshkit).
An example setting a working directory, user and environment variable:
{% prism ruby %}
on roles(:app), in: :sequence, wait: 5 do
within "/opt/sites/example.com" do
# commands in this block execute in the
# directory: /opt/sites/example.com
as :deploy do
# commands in this block execute as the "deploy" user.
with rails_env: :production do
# commands in this block execute with the environment
# variable RAILS_ENV=production
rake "assets:precompile"
runner "S3::Sync.notify"
end
end
end
end
{% endprism %}
For more examples, see the EXAMPLES.md file in the [**SSHKit**](https://github.com/capistrano/sshkit) project:
[https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md](https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md)

View file

@ -65,7 +65,7 @@ writing your own tasks, namely `desc()`, `task()`, `on()`, `roles()`,
The first two methods, `desc()` and `task()` are actually from Rake, the
library that forms the foundation of the Capistrano task system, the other
methods are part of our sub-project
[**SSHKit**](https://github.com/leehambley/sshkit). We'll dive into those more
[**SSHKit**](https://github.com/capistrano/sshkit). We'll dive into those more
later, but add those lines to a file in `./lib/capistrano/tasks`, call it
something like `access_check.cap`, and run `cap -T` from the top directory and
we'll be able to see the task listed:

View file

@ -67,6 +67,8 @@ This will create a bunch of files, the important ones are:
└── tasks
{% endprism %}
Your new Capfile will automatically any tasks from any *.cap files in lib/capistrano/tasks.
### 4. Configure your server addresses in the generated files.
We'll just work with the staging environment here, so you can pretend that