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

Build and deploy latest docs contributions /cc @kirs

This commit is contained in:
Lee Hambley 2013-11-21 11:19:48 +01:00
parent 73cd09bfb8
commit 23a6d0bd86
20 changed files with 330 additions and 138 deletions

View file

@ -1,5 +1,5 @@
require 'time'
require 'sshkit'
require 'sshkit/dsl'
deploy_to = '/opt/sites/capistranorb_com'
release_timestamp = Time.now.utc.strftime("%Y%m%d%H%m%S")

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>
@ -120,7 +121,7 @@ are pleased to announce the first <em>major</em> release of Capistrano in almost
years.</p>
<p>The reasons behind the length of time between the last architectural overhaul
and this one are numerous, but it can be summrised to say that Capistrano is a
and this one are numerous, but it can be summarised to say that Capistrano is a
widely used tool, and when working around software deployment it&#39;s really a
question of downtime. If we had changed something significant in Capistrano we
could have taken a lot of sites offline, and made a lot of people very
@ -128,8 +129,8 @@ unhappy. Until this point we haven&#39;t felt that the time has been ripe where
the benefits of a slightly rocky upgrade path are worth the risks of downtime.</p>
<p>It also hasn&#39;t helped historically that we&#39;ve only just gotten to grips with
Ruby 1.9, and that Bundler&#39;s near ubuquity means that now it&#39;s trivial to lock
a Gem at a specific version. With other tools in the Ruby eco system it&#39;s
Ruby 1.9, and that Bundler&#39;s near ubiquity means that now it&#39;s trivial to lock
a Gem at a specific version. With other tools in the Ruby ecosystem it&#39;s
become easier for us to make significant changes to a tool upon which many
hundreds of thousands of people rely.</p>
@ -179,13 +180,13 @@ people who are interested in contributing, or sharing expertise on the
<em>best-practice</em> way of speedily deploying from your respective choice of
source control.</li>
<li>**<code>HOSTFILTER</code> ,<code>ROLEFILTER</code> and friends** These have gone away because we
always felt they were indemic of a bad design desision about using
always felt they were endemic of a bad design decision about using
Environmental Variables. These will be coming back as flags passed to <code>cap</code>
on the CLI, and options that can be set on the Capistrano::Application Ruby
on the CLI, and options that can be set on the <code>Capistrano::Application</code> Ruby
class.</li>
<li><strong>Shell</strong> The shell has been removed temporarily pending a neater
implementation, we&#39;ve got something that we are playing with internally, but
it needs better readline support, and some more controls around what to do
it needs better <code>readline</code> support, and some more controls around what to do
when things go badly on some servers, but not others.</li>
<li><strong>Cold Deploy</strong> The <code>cap deploy:cold</code> is a really old legacy component,
orignally from the days of the <code>script/spinner</code> where deploying cold
@ -248,14 +249,14 @@ end</code></pre>
resolve this dependency at Runtime, mailing the recent changelog to your team,
assuming everything is setup correctly.</p>
<h4 id="toc_4">Built In Stage Support</h4>
<h4 id="toc_4">Built-In Stage Support</h4>
<p>In former versions of Capistrano <em>stage</em> support was an after thought,
provided through the <code>capistrano-ext</code> Gem, and latterly merged into the main
provided through the <code>capistrano-ext</code> Gem, and laterally merged into the main
codebase, people insisted in still using the <code>capistrano-ext</code> version
regardless.</p>
<p>In Capistrano 3.0.x there&#39;s stage support built in, at installation time, two
<p>In Capistrano 3.0.x there&#39;s stage support built-in, at installation time, two
stages will be created by default, <em>staging</em> and <em>production</em>; it&#39;s easy to
add more, just add a file to <code>config/deploy/______.rb</code> which follows the
conventions established in the examples we created for you.</p>
@ -362,7 +363,7 @@ did something clever that wasn&#39;t possible in Capistrano v2; we accessed the
<p>For a lot of reasons in Capistrano v2 is wasn&#39;t possible to do this, the block
was essentially evaluated once and called verbatim on each host. This lead to
disappointing missing features such as not being able to pull the host list
out of Capistrano and examine the roles to do something like controlling chef
out of Capistrano and examine the roles to do something like controlling Chef
solo, or similar.</p>
<p>In Capistrano v3 the <code>host</code> object is the same object that is created when a
@ -385,7 +386,7 @@ releases there.</p>
implementations silently only ran on the first server that matched the
properties defined, so server one returned a list of ~95 old timestamped
release directories. Next Capistrano v2 would call <code>rm -rf
release1..release95</code> on <strong>both</strong> servers, causing server two to err our, and
release1..release95</code> on <strong>both</strong> servers, causing server two to error out, and
leaving an undefined state on server one, as Capistrano would simply hang up
both connections.</p>
</blockquote>
@ -395,7 +396,7 @@ actually more or less the actual implementation in the the new Gem):</p>
<div>
<pre data-line=''><code class='language-ruby'># Capistrano 3.0.x
desc &quot;Cleanup all old releases (keeps #{fetch(:releases_to_keeo_on_cleanup)}
desc &quot;Cleanup all old releases (keeps #{fetch(:releases_to_keep_on_cleanup)}
old releases&quot;
task :cleanup do
keep_releases = fetch(:releases_to_keep_on_cleanup)
@ -412,7 +413,7 @@ contrived example will both evaluate that independently, and when both servers
are finished removing old releases the <code>task :cleanup</code> block will have
finished.</p>
<p>Also in Capistrano v3 most path varaibles are [<code>Pathname</code>] objects, so they natively
<p>Also in Capistrano v3 most path variables are [<code>Pathname</code>] objects, so they natively
respond to things like <code>#basename</code>, <code>#expand_path</code>, <code>#join</code> and similar.</p>
<p><strong>Warning:</strong> <code>#expand_path</code> probably won&#39;t do what you expect, it will execute
@ -476,12 +477,12 @@ you, environmental variables are capitalised and applied at the correct point
<h4 id="toc_10">Better <em>magic</em> Variable Support</h4>
<p>In Capistrano v2 there were certain bits of magic where if calling a variable
and NoMethodError would have been raised (for example the
<code>latest_release_directory</code> varaible). This variable never existed on the
and <code>NoMethodError</code> would have been raised (for example the
<code>latest_release_directory</code> variable). This variable never existed on the
global namespace, as a fall-back the list of <code>set()</code> variables would be
consulted.</p>
<p>This magic lead to times when people were not recognising that magic variables
<p>This magic led to times when people were not recognising that magic variables
were even being used. The magic variable system of Capistrano v2 did also
include a way to <code>fetch(:some_variable, &#39;with a default value&#39;)</code> incase the
variable might not be set already, but it wasn&#39;t widely used, and more often
@ -499,11 +500,11 @@ explicit caching. <em>Again, we are favoring clarity over micro optimisation</em
<h4 id="toc_11">SSHKit</h4>
<p>Many of the new features in Capistrano whch relate to logging, formatting,
SSH, connection management and pooling, parallism, batch execution and more
<p>Many of the new features in Capistrano which relate to logging, formatting,
SSH, connection management and pooling, parallelism, batch execution and more
are from a library that fell out of the Capistrano v3 development process.</p>
<p>[*SSHKit*][] is a lower level toolkit, a level higher than <em>Net::SSH</em>, still
<p><a href="https://github.com/leehambley/sshkit"><em>SSHKit</em></a> is a lower level toolkit, a level higher than <em>Net::SSH</em> still,
but lacking the roles, environments, rollbacks and other higher level features
from Capistrano.</p>
@ -588,7 +589,7 @@ exec</code>, and in this case could be mapped to:</p>
SSHKit.config.command_map[:rails] = &quot;bundle exec rails&quot;</code></pre>
</div>
<p>There can also be a lamda or Proc applied in place of the mapping like so:</p>
<p>There can also be a <code>lambda</code> or <code>Proc</code> applied in place of the mapping like so:</p>
<div>
<pre data-line=''><code class='language-ruby'>SSHKit.config.command_map = Hash.new do |hash, key|
@ -624,7 +625,7 @@ environment without requiring an interactive login shell.</p>
<h4 id="toc_13">Testing</h4>
<p>The old test suite for Capistrano was purely unit tests, and didn&#39;t cover a
wide varity of problem cases, specifically nothing in the <code>deploy.rb</code> (that is
wide variety of problem cases, specifically nothing in the <code>deploy.rb</code> (that is
the actual <em>deployment</em> code) was tested at all; because of having our own DSL
implementation, and other slightly odd design points, it was painful to test
the actual <em>recipes</em>.</p>
@ -707,7 +708,7 @@ are pleased to announce the first <em>major</em> release of Capistrano in almost
years.</p>
<p>The reasons behind the length of time between the last architectural overhaul
and this one are numerous, but it can be summrised to say that Capistrano is a
and this one are numerous, but it can be summarised to say that Capistrano is a
widely used tool, and when working around software deployment it&#39;s really a
question of downtime. If we had changed something significant in Capistrano we
could have taken a lot of sites offline, and made a lot of people very
@ -715,8 +716,8 @@ unhappy. Until this point we haven&#39;t felt that the time has been ripe where
the benefits of a slightly rocky upgrade path are worth the risks of downtime.</p>
<p>It also hasn&#39;t helped historically that we&#39;ve only just gotten to grips with
Ruby 1.9, and that Bundler&#39;s near ubuquity means that now it&#39;s trivial to lock
a Gem at a specific version. With other tools in the Ruby eco system it&#39;s
Ruby 1.9, and that Bundler&#39;s near ubiquity means that now it&#39;s trivial to lock
a Gem at a specific version. With other tools in the Ruby ecosystem it&#39;s
become easier for us to make significant changes to a tool upon which many
hundreds of thousands of people rely.</p>
@ -766,13 +767,13 @@ people who are interested in contributing, or sharing expertise on the
<em>best-practice</em> way of speedily deploying from your respective choice of
source control.</li>
<li>**<code>HOSTFILTER</code> ,<code>ROLEFILTER</code> and friends** These have gone away because we
always felt they were indemic of a bad design desision about using
always felt they were endemic of a bad design decision about using
Environmental Variables. These will be coming back as flags passed to <code>cap</code>
on the CLI, and options that can be set on the Capistrano::Application Ruby
on the CLI, and options that can be set on the <code>Capistrano::Application</code> Ruby
class.</li>
<li><strong>Shell</strong> The shell has been removed temporarily pending a neater
implementation, we&#39;ve got something that we are playing with internally, but
it needs better readline support, and some more controls around what to do
it needs better <code>readline</code> support, and some more controls around what to do
when things go badly on some servers, but not others.</li>
<li><strong>Cold Deploy</strong> The <code>cap deploy:cold</code> is a really old legacy component,
orignally from the days of the <code>script/spinner</code> where deploying cold
@ -835,14 +836,14 @@ end</code></pre>
resolve this dependency at Runtime, mailing the recent changelog to your team,
assuming everything is setup correctly.</p>
<h4 id="toc_4">Built In Stage Support</h4>
<h4 id="toc_4">Built-In Stage Support</h4>
<p>In former versions of Capistrano <em>stage</em> support was an after thought,
provided through the <code>capistrano-ext</code> Gem, and latterly merged into the main
provided through the <code>capistrano-ext</code> Gem, and laterally merged into the main
codebase, people insisted in still using the <code>capistrano-ext</code> version
regardless.</p>
<p>In Capistrano 3.0.x there&#39;s stage support built in, at installation time, two
<p>In Capistrano 3.0.x there&#39;s stage support built-in, at installation time, two
stages will be created by default, <em>staging</em> and <em>production</em>; it&#39;s easy to
add more, just add a file to <code>config/deploy/______.rb</code> which follows the
conventions established in the examples we created for you.</p>
@ -949,7 +950,7 @@ did something clever that wasn&#39;t possible in Capistrano v2; we accessed the
<p>For a lot of reasons in Capistrano v2 is wasn&#39;t possible to do this, the block
was essentially evaluated once and called verbatim on each host. This lead to
disappointing missing features such as not being able to pull the host list
out of Capistrano and examine the roles to do something like controlling chef
out of Capistrano and examine the roles to do something like controlling Chef
solo, or similar.</p>
<p>In Capistrano v3 the <code>host</code> object is the same object that is created when a
@ -972,7 +973,7 @@ releases there.</p>
implementations silently only ran on the first server that matched the
properties defined, so server one returned a list of ~95 old timestamped
release directories. Next Capistrano v2 would call <code>rm -rf
release1..release95</code> on <strong>both</strong> servers, causing server two to err our, and
release1..release95</code> on <strong>both</strong> servers, causing server two to error out, and
leaving an undefined state on server one, as Capistrano would simply hang up
both connections.</p>
</blockquote>
@ -982,7 +983,7 @@ actually more or less the actual implementation in the the new Gem):</p>
<div>
<pre data-line=''><code class='language-ruby'># Capistrano 3.0.x
desc &quot;Cleanup all old releases (keeps #{fetch(:releases_to_keeo_on_cleanup)}
desc &quot;Cleanup all old releases (keeps #{fetch(:releases_to_keep_on_cleanup)}
old releases&quot;
task :cleanup do
keep_releases = fetch(:releases_to_keep_on_cleanup)
@ -999,7 +1000,7 @@ contrived example will both evaluate that independently, and when both servers
are finished removing old releases the <code>task :cleanup</code> block will have
finished.</p>
<p>Also in Capistrano v3 most path varaibles are [<code>Pathname</code>] objects, so they natively
<p>Also in Capistrano v3 most path variables are [<code>Pathname</code>] objects, so they natively
respond to things like <code>#basename</code>, <code>#expand_path</code>, <code>#join</code> and similar.</p>
<p><strong>Warning:</strong> <code>#expand_path</code> probably won&#39;t do what you expect, it will execute
@ -1063,12 +1064,12 @@ you, environmental variables are capitalised and applied at the correct point
<h4 id="toc_10">Better <em>magic</em> Variable Support</h4>
<p>In Capistrano v2 there were certain bits of magic where if calling a variable
and NoMethodError would have been raised (for example the
<code>latest_release_directory</code> varaible). This variable never existed on the
and <code>NoMethodError</code> would have been raised (for example the
<code>latest_release_directory</code> variable). This variable never existed on the
global namespace, as a fall-back the list of <code>set()</code> variables would be
consulted.</p>
<p>This magic lead to times when people were not recognising that magic variables
<p>This magic led to times when people were not recognising that magic variables
were even being used. The magic variable system of Capistrano v2 did also
include a way to <code>fetch(:some_variable, &#39;with a default value&#39;)</code> incase the
variable might not be set already, but it wasn&#39;t widely used, and more often
@ -1086,11 +1087,11 @@ explicit caching. <em>Again, we are favoring clarity over micro optimisation</em
<h4 id="toc_11">SSHKit</h4>
<p>Many of the new features in Capistrano whch relate to logging, formatting,
SSH, connection management and pooling, parallism, batch execution and more
<p>Many of the new features in Capistrano which relate to logging, formatting,
SSH, connection management and pooling, parallelism, batch execution and more
are from a library that fell out of the Capistrano v3 development process.</p>
<p>[*SSHKit*][] is a lower level toolkit, a level higher than <em>Net::SSH</em>, still
<p><a href="https://github.com/leehambley/sshkit"><em>SSHKit</em></a> is a lower level toolkit, a level higher than <em>Net::SSH</em> still,
but lacking the roles, environments, rollbacks and other higher level features
from Capistrano.</p>
@ -1175,7 +1176,7 @@ exec</code>, and in this case could be mapped to:</p>
SSHKit.config.command_map[:rails] = &quot;bundle exec rails&quot;</code></pre>
</div>
<p>There can also be a lamda or Proc applied in place of the mapping like so:</p>
<p>There can also be a <code>lambda</code> or <code>Proc</code> applied in place of the mapping like so:</p>
<div>
<pre data-line=''><code class='language-ruby'>SSHKit.config.command_map = Hash.new do |hash, key|
@ -1211,7 +1212,7 @@ environment without requiring an interactive login shell.</p>
<h4 id="toc_13">Testing</h4>
<p>The old test suite for Capistrano was purely unit tests, and didn&#39;t cover a
wide varity of problem cases, specifically nothing in the <code>deploy.rb</code> (that is
wide variety of problem cases, specifically nothing in the <code>deploy.rb</code> (that is
the actual <em>deployment</em> code) was tested at all; because of having our own DSL
implementation, and other slightly odd design points, it was painful to test
the actual <em>recipes</em>.</p>

View file

@ -1,5 +1,5 @@
require 'time'
require 'sshkit'
require 'sshkit/dsl'
deploy_to = '/opt/sites/capistranorb_com'
release_timestamp = Time.now.utc.strftime("%Y%m%d%H%m%S")

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>
@ -124,7 +125,7 @@ matrix of possibilities concerning <code>login</code>, <code>non-login</code>, <
<h2 id="toc_0">Shell Modes</h2>
<p>Unix shells can be started in one of three modes, an unnamed <em>basic</em> mode,
which almost never happens, as a <code>login</code> shell, or as an <code>inteactive</code> shell.</p>
which almost never happens, as a <code>login</code> shell, or as an <code>interactive</code> shell.</p>
<p>Depending which mode a shell starts in (and which shell you are using) this
will affect which startup (more commonly known as <em>dot</em>-files) files, if any
@ -252,7 +253,7 @@ matrix of possibilities concerning <code>login</code>, <code>non-login</code>, <
<h2 id="toc_0">Shell Modes</h2>
<p>Unix shells can be started in one of three modes, an unnamed <em>basic</em> mode,
which almost never happens, as a <code>login</code> shell, or as an <code>inteactive</code> shell.</p>
which almost never happens, as a <code>login</code> shell, or as an <code>interactive</code> shell.</p>
<p>Depending which mode a shell starts in (and which shell you are using) this
will affect which startup (more commonly known as <em>dot</em>-files) files, if any

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>
@ -212,7 +213,7 @@ simply call:</p>
</div>
<p>This task is defined
<a href="https://github.com/capistrano/capistrano/blob/v3/lib/capistrano/tasks/git.rake#L17">here</a>
<a href="https://github.com/capistrano/capistrano/blob/master/lib/capistrano/tasks/git.rake">here</a>
in the source code, and looks a lot like what we wrote above to check the file
permissions, however the Git check recipe is a bit more complicated, having to
potentially deal with three different authentication schemes, which need to be
@ -432,7 +433,7 @@ simply call:</p>
</div>
<p>This task is defined
<a href="https://github.com/capistrano/capistrano/blob/v3/lib/capistrano/tasks/git.rake#L17">here</a>
<a href="https://github.com/capistrano/capistrano/blob/master/lib/capistrano/tasks/git.rake">here</a>
in the source code, and looks a lot like what we wrote above to check the file
permissions, however the Git check recipe is a bit more complicated, having to
potentially deal with three different authentication schemes, which need to be

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>
@ -124,9 +125,7 @@ therefore recommended to use an appropriate bundler.
<h3 id="toc_0">General Usage</h3>
<p>The following commands will clone Capistrano at the latest <code>v3</code> revision, and
will build the gem and install it locally. <strong>The Gem is not yet availalble via
Rubygems.org.</strong></p>
<p>The following command will install the latest released capistrano <code>v3</code> revision:</p>
<div>
<pre data-line=''><code class='language-bash'>$ gem install capistrano</code></pre>
@ -141,31 +140,7 @@ $ gem build *.gemspec
$ gem install *.gem</code></pre>
</div>
<h3 id="toc_1">Signed Rubygems (currently not signed)</h3>
<p>As Capistrano is a signed gem, you should always be careful to use the
<code>--trust-policy</code> flag when installing Gems, or since Bundler 1.3 you should
use the same flag:</p>
<div>
<pre data-line=''><code class='language-bash'>$ gem install capistrano --trust-policy HighSecurity
$ bundle install --trust-policy HighSecurity</code></pre>
</div>
<p>If you get a message that looks like:</p>
<div>
<pre data-line=''><code class='language-bash'>ERROR: While executing gem ... (Gem::Security::Exception)
unsigned gems are not allowed by the High Security policy</code></pre>
</div>
<p>Then <strong><em>please</em></strong> complain to your Gem author, and have them start signing
their Gems.</p>
<p>(<a href="http://blog.meldium.com/home/2013/3/3/signed-rubygems-part">More information about using Bundler with signed
gems</a>)</p>
<h3 id="toc_2">Usage in a Rails project</h3>
<h3 id="toc_1">Usage in a Rails project</h3>
<p>Add the following lines to the Gemfile to the <code>:development</code> group ideally.</p>
@ -217,7 +192,7 @@ install <code>2.15.4</code>, and any other point-release in the <code>2.15.x</co
the risk of accidentally upgrading to <code>v3</code>.
</div></p>
<h2 id="toc_3"></h2>
<h2 id="toc_2"></h2>
</div>
</div>
@ -240,9 +215,7 @@ therefore recommended to use an appropriate bundler.
<h3 id="toc_0">General Usage</h3>
<p>The following commands will clone Capistrano at the latest <code>v3</code> revision, and
will build the gem and install it locally. <strong>The Gem is not yet availalble via
Rubygems.org.</strong></p>
<p>The following command will install the latest released capistrano <code>v3</code> revision:</p>
<div>
<pre data-line=''><code class='language-bash'>$ gem install capistrano</code></pre>
@ -257,31 +230,7 @@ $ gem build *.gemspec
$ gem install *.gem</code></pre>
</div>
<h3 id="toc_1">Signed Rubygems (currently not signed)</h3>
<p>As Capistrano is a signed gem, you should always be careful to use the
<code>--trust-policy</code> flag when installing Gems, or since Bundler 1.3 you should
use the same flag:</p>
<div>
<pre data-line=''><code class='language-bash'>$ gem install capistrano --trust-policy HighSecurity
$ bundle install --trust-policy HighSecurity</code></pre>
</div>
<p>If you get a message that looks like:</p>
<div>
<pre data-line=''><code class='language-bash'>ERROR: While executing gem ... (Gem::Security::Exception)
unsigned gems are not allowed by the High Security policy</code></pre>
</div>
<p>Then <strong><em>please</em></strong> complain to your Gem author, and have them start signing
their Gems.</p>
<p>(<a href="http://blog.meldium.com/home/2013/3/3/signed-rubygems-part">More information about using Bundler with signed
gems</a>)</p>
<h3 id="toc_2">Usage in a Rails project</h3>
<h3 id="toc_1">Usage in a Rails project</h3>
<p>Add the following lines to the Gemfile to the <code>:development</code> group ideally.</p>
@ -333,7 +282,7 @@ install <code>2.15.4</code>, and any other point-release in the <code>2.15.x</co
the risk of accidentally upgrading to <code>v3</code>.
</div></p>
<h2 id="toc_3"></h2>
<h2 id="toc_2"></h2>
-->
<!--</div> [> /container <] -->

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -0,0 +1,259 @@
<!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>Role 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 & 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><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</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>Role filtering</h2>
<p>You may have situations where you only want to deploy to servers matching
a single role. For example, you may have changed some aspect of how the web
role works, but don&#39;t want to trigger a deployment to your database servers.</p>
<p>You can use the <em>role filter</em> to restrict Capistrano tasks to only servers
match a given role or roles.</p>
<p>If the filter matches no servers, no actions will be taken.</p>
<p>If you specify a filter, it will match any servers that have that role, but
it will <em>only</em> run the tasks for that role, not for any other roles that
server may have. For example, if you filtered for servers with the <code>web</code> role,
and a server had both the <code>web</code> and <code>db</code> role, only the <code>web</code> role would
be executed on it.</p>
<h3 id="toc_0">Specifying a role filter</h3>
<p>There are three ways to specify the role filter.</p>
<h4 id="toc_1">Environment variable</h4>
<p>Capistrano will read the role filter from the environment variable <code>ROLES</code>
if it is set. You can set it inline:</p>
<div class="highlight"><pre><code class="text language-text" data-lang="text">ROLES=app,web cap production deploy
</code></pre></div>
<p>Specify multiple roles by separating them with a comma.</p>
<h4 id="toc_2">In configuration</h4>
<p>You can set the role filter inside your deploy configuration. For example,
you can set the following inside <code>config/deploy.rb</code>:</p>
<div class="highlight"><pre><code class="text language-text" data-lang="text">set :filter, :roles =&gt; %w{app web}
</code></pre></div>
<p>Note that you specify the filter as an array rather than as a comma-separated
list of roles 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 class="highlight"><pre><code class="text language-text" data-lang="text">cap --roles=app,web production deploy
</code></pre></div>
<p>Like the environment variable method, specify multiple roles 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 have situations where you only want to deploy to servers matching
a single role. For example, you may have changed some aspect of how the web
role works, but don&#39;t want to trigger a deployment to your database servers.</p>
<p>You can use the <em>role filter</em> to restrict Capistrano tasks to only servers
match a given role or roles.</p>
<p>If the filter matches no servers, no actions will be taken.</p>
<p>If you specify a filter, it will match any servers that have that role, but
it will <em>only</em> run the tasks for that role, not for any other roles that
server may have. For example, if you filtered for servers with the <code>web</code> role,
and a server had both the <code>web</code> and <code>db</code> role, only the <code>web</code> role would
be executed on it.</p>
<h3 id="toc_0">Specifying a role filter</h3>
<p>There are three ways to specify the role filter.</p>
<h4 id="toc_1">Environment variable</h4>
<p>Capistrano will read the role filter from the environment variable <code>ROLES</code>
if it is set. You can set it inline:</p>
<div class="highlight"><pre><code class="text language-text" data-lang="text">ROLES=app,web cap production deploy
</code></pre></div>
<p>Specify multiple roles by separating them with a comma.</p>
<h4 id="toc_2">In configuration</h4>
<p>You can set the role filter inside your deploy configuration. For example,
you can set the following inside <code>config/deploy.rb</code>:</p>
<div class="highlight"><pre><code class="text language-text" data-lang="text">set :filter, :roles =&gt; %w{app web}
</code></pre></div>
<p>Note that you specify the filter as an array rather than as a comma-separated
list of roles 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 class="highlight"><pre><code class="text language-text" data-lang="text">cap --roles=app,web production deploy
</code></pre></div>
<p>Like the environment variable method, specify multiple roles by separating them
with a comma.</p>
-->
<!--</div> [> /container <] -->
<footer>
<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="https://rubygems.org/gems/capistrano/versions">Releases</a></li>
<li><a href="/documentation/upgrading">Upgrading</a></li>
<li><a href="/security">Security</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>
<li><a href=".... ">Commercial Support</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

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>
@ -185,22 +186,6 @@ CMD</code></pre>
end</code></pre>
</div>
<h4 id="toc_2">Refactor roles</h4>
<p>Instead of:</p>
<div>
<pre data-line=''><code class='language-ruby'>role :app, %w{example.com}
role :web, %w{example.com}
role :db, %w{example.com}</code></pre>
</div>
<p>It&#39;s better to use:</p>
<div>
<pre data-line=''><code class='language-ruby'>role :all, %w{example.com}</code></pre>
</div>
</div>
</div>
</div>
@ -281,22 +266,6 @@ CMD</code></pre>
execute :rake, &#39;assets:precompile&#39;
end
end</code></pre>
</div>
<h4 id="toc_2">Refactor roles</h4>
<p>Instead of:</p>
<div>
<pre data-line=''><code class='language-ruby'>role :app, %w{example.com}
role :web, %w{example.com}
role :db, %w{example.com}</code></pre>
</div>
<p>It&#39;s better to use:</p>
<div>
<pre data-line=''><code class='language-ruby'>role :all, %w{example.com}</code></pre>
</div>
-->

View file

@ -75,6 +75,7 @@
<li><a href="/documentation/getting-started/flow/">Flow</a></li>
<li><a href="/documentation/getting-started/rollbacks/">Rollbacks</a></li>
<li><a href="/documentation/getting-started/remote-file/">Remote file task</a></li>
<li><a href="/documentation/getting-started/role-filtering/">Role filtering</a></li>
<li class="divider"></li>
<h5>Framework Extensions</h5>
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</a></li>