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

Fixing version of jekyll

This commit is contained in:
Kir Shatrov 2013-08-19 00:37:50 +04:00
parent 781271c95c
commit 3f33beedb4
11 changed files with 98 additions and 96 deletions

View file

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

View file

@ -17,18 +17,19 @@ GEM
fast-stemmer (1.0.2)
git (1.2.5)
highline (1.6.19)
jekyll (1.0.2)
jekyll (1.1.2)
classifier (~> 1.3)
colorator (~> 0.1)
commander (~> 4.1.3)
directory_watcher (~> 1.4.1)
kramdown (~> 1.0.2)
liquid (~> 2.3)
liquid (~> 2.5.1)
maruku (~> 0.5)
pygments.rb (~> 0.5.0)
redcarpet (~> 2.2.2)
safe_yaml (~> 0.7.0)
kramdown (1.0.2)
liquid (2.5.0)
liquid (2.5.1)
maruku (0.6.1)
syntax (>= 1.0.0)
posix-spawn (0.3.6)
@ -47,6 +48,6 @@ PLATFORMS
DEPENDENCIES
debugger
git
jekyll
jekyll (~> 1.1.2)
redcarpet
unindent

View file

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

View file

@ -17,18 +17,19 @@ GEM
fast-stemmer (1.0.2)
git (1.2.5)
highline (1.6.19)
jekyll (1.0.2)
jekyll (1.1.2)
classifier (~> 1.3)
colorator (~> 0.1)
commander (~> 4.1.3)
directory_watcher (~> 1.4.1)
kramdown (~> 1.0.2)
liquid (~> 2.3)
liquid (~> 2.5.1)
maruku (~> 0.5)
pygments.rb (~> 0.5.0)
redcarpet (~> 2.2.2)
safe_yaml (~> 0.7.0)
kramdown (1.0.2)
liquid (2.5.0)
liquid (2.5.1)
maruku (0.6.1)
syntax (>= 1.0.0)
posix-spawn (0.3.6)
@ -47,6 +48,6 @@ PLATFORMS
DEPENDENCIES
debugger
git
jekyll
jekyll (~> 1.1.2)
redcarpet
unindent

View file

@ -170,9 +170,9 @@ what happens:</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote
me@remote $ [[ $- == *i* ]] &amp;&amp; echo &#39;Interactive&#39; || echo &#39;Not interactive&#39;
me@remote $ [[ $- == *i* ]] &amp;&amp; echo 'Interactive' || echo 'Not interactive'
Interactive
me@remote $ shopt -q login_shell &amp;&amp; echo &#39;Login shell&#39; || echo &#39;Not login shell&#39;
me@remote $ shopt -q login_shell &amp;&amp; echo 'Login shell' || echo 'Not login shell'
Login shell</code></pre>
</div>
@ -180,9 +180,9 @@ Login shell</code></pre>
command line without logging in first...</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote &quot;[[ $- == *i* ]] &amp;&amp; echo &#39;Interactive&#39; || echo &#39;Not interactive&#39;&quot;
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote &quot;[[ $- == *i* ]] &amp;&amp; echo 'Interactive' || echo 'Not interactive'&quot;
Interactive
me@localhost $ ssh me@remote &quot;shopt -q login_shell &amp;&amp; echo &#39;Login shell&#39; || echo &#39;Not login shell&#39;&quot;
me@localhost $ ssh me@remote &quot;shopt -q login_shell &amp;&amp; echo 'Login shell' || echo 'Not login shell'&quot;
Not login shell</code></pre>
</div>
@ -197,13 +197,13 @@ recipes to test this:</p>
<div>
<pre data-line=''><code class='language-ruby'># Capistrano 3.0.x
task :query_interactive do
on &#39;me@remote&#39; do
info capture(&quot;[[ $- == *i* ]] &amp;&amp; echo &#39;Interactive&#39; || echo &#39;Not interactive&#39;&quot;)
on 'me@remote' do
info capture(&quot;[[ $- == *i* ]] &amp;&amp; echo 'Interactive' || echo 'Not interactive'&quot;)
end
end
task :query_login do
on &#39;me@remote&#39; do
info capture(&quot;shopt -q login_shell &amp;&amp; echo &#39;Login shell&#39; || echo &#39;Not login shell&#39;&quot;)
on 'me@remote' do
info capture(&quot;shopt -q login_shell &amp;&amp; echo 'Login shell' || echo 'Not login shell'&quot;)
end
end</code></pre>
</div>
@ -298,9 +298,9 @@ what happens:</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote
me@remote $ [[ $- == *i* ]] &amp;&amp; echo &#39;Interactive&#39; || echo &#39;Not interactive&#39;
me@remote $ [[ $- == *i* ]] &amp;&amp; echo 'Interactive' || echo 'Not interactive'
Interactive
me@remote $ shopt -q login_shell &amp;&amp; echo &#39;Login shell&#39; || echo &#39;Not login shell&#39;
me@remote $ shopt -q login_shell &amp;&amp; echo 'Login shell' || echo 'Not login shell'
Login shell</code></pre>
</div>
@ -308,9 +308,9 @@ Login shell</code></pre>
command line without logging in first...</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote &quot;[[ $- == *i* ]] &amp;&amp; echo &#39;Interactive&#39; || echo &#39;Not interactive&#39;&quot;
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote &quot;[[ $- == *i* ]] &amp;&amp; echo 'Interactive' || echo 'Not interactive'&quot;
Interactive
me@localhost $ ssh me@remote &quot;shopt -q login_shell &amp;&amp; echo &#39;Login shell&#39; || echo &#39;Not login shell&#39;&quot;
me@localhost $ ssh me@remote &quot;shopt -q login_shell &amp;&amp; echo 'Login shell' || echo 'Not login shell'&quot;
Not login shell</code></pre>
</div>
@ -325,13 +325,13 @@ recipes to test this:</p>
<div>
<pre data-line=''><code class='language-ruby'># Capistrano 3.0.x
task :query_interactive do
on &#39;me@remote&#39; do
info capture(&quot;[[ $- == *i* ]] &amp;&amp; echo &#39;Interactive&#39; || echo &#39;Not interactive&#39;&quot;)
on 'me@remote' do
info capture(&quot;[[ $- == *i* ]] &amp;&amp; echo 'Interactive' || echo 'Not interactive'&quot;)
end
end
task :query_login do
on &#39;me@remote&#39; do
info capture(&quot;shopt -q login_shell &amp;&amp; echo &#39;Login shell&#39; || echo &#39;Not login shell&#39;&quot;)
on 'me@remote' do
info capture(&quot;shopt -q login_shell &amp;&amp; echo 'Login shell' || echo 'Not login shell'&quot;)
end
end</code></pre>
</div>

View file

@ -160,7 +160,7 @@ quits or gets fired, you can remove their key from that file, and the rest of
you can keep on shipping!</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh-keygen -t rsa -C &#39;me@my_email_address.com&#39;</code></pre>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh-keygen -t rsa -C 'me@my_email_address.com'</code></pre>
</div>
<p>You&#39;ll be prompted for a passphrase, that&#39;s fine. Type one and keep it safe.
@ -238,7 +238,7 @@ use the same key for each one, but only one key per developer is recommended.
<p>If we did all that correctly, we should now be able to do something like this:</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh deploy@one-of-my-servers.com &#39;hostname; uptime&#39;
<pre data-line=''><code class='language-bash'>me@localhost $ ssh deploy@one-of-my-servers.com 'hostname; uptime'
one-of-my-servers.com
19:23:32 up 62 days, 44 min, 1 user, load average: 0.00, 0.01, 0.05</code></pre>
</div>
@ -298,9 +298,9 @@ Tutorials project.</p>
<div>
<pre data-line=''><code class='language-bash'># List SSH keys that are loaded into the agent
me@localhost $ ssh-add -l
# Make sure they key is loaded if &#39;ssh-add -l&#39; didn&#39;t show anything
# Make sure they key is loaded if 'ssh-add -l' didn't show anything
me@localhost $ ssh-add
me@localhost $ ssh -A deploy@one-of-my-servers.com &#39;git ls-remote git@github.com:capistrano/rails3-bootstrap-devise-cancan.git</code></pre>
me@localhost $ ssh -A deploy@one-of-my-servers.com 'git ls-remote git@github.com:capistrano/rails3-bootstrap-devise-cancan.git</code></pre>
</div>
<p>We first check that the agent has the keys loaded. If not we simply load it
@ -318,7 +318,7 @@ it both ways just to know how your system treats agent forwarding by default.</p
specified on a per-host basis in a configuration file.
Agent forwarding should be enabled with caution. Users with the ability to
bypass file permissions on the remote host (for the agent&#39;s UNIX-domain
bypass file permissions on the remote host (for the agent's UNIX-domain
socket) can access the local agent through the forwarded connection. An
attacker cannot obtain key material from the agent, however they can perform
operations on the keys that enable them to authenticate using the identities
@ -344,8 +344,8 @@ Github, we&#39;ll be prompted for a username and password:</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ git ls-remote https://github.com/capistrano/rails3-bootstrap-devise-cancan.git
Username for &#39;https://github.com&#39;: myownusername
Password for &#39;https://capistrano@github.com&#39;:</code></pre>
Username for 'https://github.com': myownusername
Password for 'https://capistrano@github.com':</code></pre>
</div>
<p>This challenge response prompt doesn&#39;t work well for automating things, so
@ -431,7 +431,7 @@ access that you may or may not need depending how well your servers are setup:</
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh root@remote
# Capistrano will use /var/www/....... where ... is the value set in
# :application, you can override this by setting the &#39;:deploy_to&#39; variable
# :application, you can override this by setting the ':deploy_to' variable
root@remote $ deploy_to=/var/www/rails3-bootstrap-devise-cancan-demo
root@remote $ mkdir ${deploy_to}
root@remote $ chown deploy:deploy ${deploy_to}
@ -520,7 +520,7 @@ quits or gets fired, you can remove their key from that file, and the rest of
you can keep on shipping!</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh-keygen -t rsa -C &#39;me@my_email_address.com&#39;</code></pre>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh-keygen -t rsa -C 'me@my_email_address.com'</code></pre>
</div>
<p>You&#39;ll be prompted for a passphrase, that&#39;s fine. Type one and keep it safe.
@ -598,7 +598,7 @@ use the same key for each one, but only one key per developer is recommended.
<p>If we did all that correctly, we should now be able to do something like this:</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh deploy@one-of-my-servers.com &#39;hostname; uptime&#39;
<pre data-line=''><code class='language-bash'>me@localhost $ ssh deploy@one-of-my-servers.com 'hostname; uptime'
one-of-my-servers.com
19:23:32 up 62 days, 44 min, 1 user, load average: 0.00, 0.01, 0.05</code></pre>
</div>
@ -658,9 +658,9 @@ Tutorials project.</p>
<div>
<pre data-line=''><code class='language-bash'># List SSH keys that are loaded into the agent
me@localhost $ ssh-add -l
# Make sure they key is loaded if &#39;ssh-add -l&#39; didn&#39;t show anything
# Make sure they key is loaded if 'ssh-add -l' didn't show anything
me@localhost $ ssh-add
me@localhost $ ssh -A deploy@one-of-my-servers.com &#39;git ls-remote git@github.com:capistrano/rails3-bootstrap-devise-cancan.git</code></pre>
me@localhost $ ssh -A deploy@one-of-my-servers.com 'git ls-remote git@github.com:capistrano/rails3-bootstrap-devise-cancan.git</code></pre>
</div>
<p>We first check that the agent has the keys loaded. If not we simply load it
@ -678,7 +678,7 @@ it both ways just to know how your system treats agent forwarding by default.</p
specified on a per-host basis in a configuration file.
Agent forwarding should be enabled with caution. Users with the ability to
bypass file permissions on the remote host (for the agent&#39;s UNIX-domain
bypass file permissions on the remote host (for the agent's UNIX-domain
socket) can access the local agent through the forwarded connection. An
attacker cannot obtain key material from the agent, however they can perform
operations on the keys that enable them to authenticate using the identities
@ -704,8 +704,8 @@ Github, we&#39;ll be prompted for a username and password:</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ git ls-remote https://github.com/capistrano/rails3-bootstrap-devise-cancan.git
Username for &#39;https://github.com&#39;: myownusername
Password for &#39;https://capistrano@github.com&#39;:</code></pre>
Username for 'https://github.com': myownusername
Password for 'https://capistrano@github.com':</code></pre>
</div>
<p>This challenge response prompt doesn&#39;t work well for automating things, so
@ -791,7 +791,7 @@ access that you may or may not need depending how well your servers are setup:</
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh root@remote
# Capistrano will use /var/www/....... where ... is the value set in
# :application, you can override this by setting the &#39;:deploy_to&#39; variable
# :application, you can override this by setting the ':deploy_to' variable
root@remote $ deploy_to=/var/www/rails3-bootstrap-devise-cancan-demo
root@remote $ mkdir ${deploy_to}
root@remote $ chown deploy:deploy ${deploy_to}

View file

@ -127,7 +127,7 @@ technologies.</p>
<h3 id="toc_0">1. Checking the directory structure on the remote machine:</h3>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh deploy@remote &#39;ls -lR /var/www/my-application&#39;
<pre data-line=''><code class='language-bash'>me@localhost $ ssh deploy@remote 'ls -lR /var/www/my-application'
my-application:
total 8
drwxrwsr-x 2 deploy deploy 4096 Jun 24 20:55 releases
@ -229,7 +229,7 @@ DEBUG [118bd3e4] Command: /usr/bin/env chmod +x /tmp/git-ssh.sh
INFO [118bd3e4] Finished in 0.049 seconds command successful.
INFO [a996463f] Running /usr/bin/env git ls-remote git@github.com:capistrano/rails3-bootstrap-devise-cancan.git on harrow
DEBUG [a996463f] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/git-ssh.sh /usr/bin/env git ls-remote git@github.com:capistrano/rails3-bootstrap-devise-cancan.git )
DEBUG [a996463f] Warning: Permanently added &#39;github.com,204.232.175.90&#39; (RSA) to the list of known hosts.
DEBUG [a996463f] Warning: Permanently added 'github.com,204.232.175.90' (RSA) to the list of known hosts.
DEBUG [a996463f] Permission denied (publickey).
DEBUG [a996463f] fatal: The remote end hung up unexpectedly
cap aborted!
@ -295,7 +295,7 @@ DEBUG [f1269276] Finished in 0.453 seconds command successful.
<p>If you don&#39;t feel like writing a Capistrano task, one could simply do:</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh -A example.com &#39;env | grep SSH_AUTH_SOCK&#39;
<pre data-line=''><code class='language-bash'>me@localhost $ ssh -A example.com 'env | grep SSH_AUTH_SOCK'
SSH_AUTH_SOCK=/tmp/ssh-Tb6X8V53tm/agent.2934</code></pre>
</div>
@ -347,7 +347,7 @@ technologies.</p>
<h3 id="toc_0">1. Checking the directory structure on the remote machine:</h3>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh deploy@remote &#39;ls -lR /var/www/my-application&#39;
<pre data-line=''><code class='language-bash'>me@localhost $ ssh deploy@remote 'ls -lR /var/www/my-application'
my-application:
total 8
drwxrwsr-x 2 deploy deploy 4096 Jun 24 20:55 releases
@ -449,7 +449,7 @@ DEBUG [118bd3e4] Command: /usr/bin/env chmod +x /tmp/git-ssh.sh
INFO [118bd3e4] Finished in 0.049 seconds command successful.
INFO [a996463f] Running /usr/bin/env git ls-remote git@github.com:capistrano/rails3-bootstrap-devise-cancan.git on harrow
DEBUG [a996463f] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/git-ssh.sh /usr/bin/env git ls-remote git@github.com:capistrano/rails3-bootstrap-devise-cancan.git )
DEBUG [a996463f] Warning: Permanently added &#39;github.com,204.232.175.90&#39; (RSA) to the list of known hosts.
DEBUG [a996463f] Warning: Permanently added 'github.com,204.232.175.90' (RSA) to the list of known hosts.
DEBUG [a996463f] Permission denied (publickey).
DEBUG [a996463f] fatal: The remote end hung up unexpectedly
cap aborted!
@ -515,7 +515,7 @@ DEBUG [f1269276] Finished in 0.453 seconds command successful.
<p>If you don&#39;t feel like writing a Capistrano task, one could simply do:</p>
<div>
<pre data-line=''><code class='language-bash'>me@localhost $ ssh -A example.com &#39;env | grep SSH_AUTH_SOCK&#39;
<pre data-line=''><code class='language-bash'>me@localhost $ ssh -A example.com 'env | grep SSH_AUTH_SOCK'
SSH_AUTH_SOCK=/tmp/ssh-Tb6X8V53tm/agent.2934</code></pre>
</div>

View file

@ -155,11 +155,11 @@ cleanup process is usually different from deploy flow.</p>
<div>
<pre data-line=''><code class='language-ruby'># Capfile
require &#39;capistrano/setup&#39;
require &#39;capistrano/deploy&#39;
require &#39;capistrano/bundler&#39;
require &#39;capistrano/rails/migrations&#39;
require &#39;capistrano/rails/assets&#39;</code></pre>
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails/migrations'
require 'capistrano/rails/assets'</code></pre>
</div>
<p>When you run <code>cap production deploy</code>, it runs these tasks:</p>
@ -273,11 +273,11 @@ cleanup process is usually different from deploy flow.</p>
<div>
<pre data-line=''><code class='language-ruby'># Capfile
require &#39;capistrano/setup&#39;
require &#39;capistrano/deploy&#39;
require &#39;capistrano/bundler&#39;
require &#39;capistrano/rails/migrations&#39;
require &#39;capistrano/rails/assets&#39;</code></pre>
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails/migrations'
require 'capistrano/rails/assets'</code></pre>
</div>
<p>When you run <code>cap production deploy</code>, it runs these tasks:</p>

View file

@ -168,7 +168,7 @@ gems</a>)</p>
<div>
<pre data-line=''><code class='language-ruby'>group :development do
gem &#39;capistrano-rails&#39;, &#39;~&gt; 0.0.7&#39;
gem 'capistrano-rails', '~&gt; 0.0.7'
end</code></pre>
</div>
@ -194,9 +194,9 @@ part, to get the best, and most sensible results, simply <code>require</code> th
files:</p>
<div>
<pre data-line=''><code class='language-ruby'>require &#39;capistrano/rails/assets&#39;
require &#39;capistrano/rails/gem-bundler&#39;
require &#39;capistrano/rails/database-migrations&#39;</code></pre>
<pre data-line=''><code class='language-ruby'>require 'capistrano/rails/assets'
require 'capistrano/rails/gem-bundler'
require 'capistrano/rails/database-migrations'</code></pre>
</div>
<div class="alert alert-info">
@ -207,7 +207,7 @@ by mistake, then you can lock your Gem version for Capistrano at something
like:
<div>
<pre data-line=''><code class='language-ruby'>gem &#39;capistrano&#39;, &#39;~&gt; 2.15&#39; # Or whatever patch release you are using</code></pre>
<pre data-line=''><code class='language-ruby'>gem 'capistrano', '~&gt; 2.15' # Or whatever patch release you are using</code></pre>
</div>
<p>This is the <a href="http://docs.rubygems.org/read/chapter/16#page74">pessimistic operator</a> which
@ -286,7 +286,7 @@ gems</a>)</p>
<div>
<pre data-line=''><code class='language-ruby'>group :development do
gem &#39;capistrano-rails&#39;, &#39;~&gt; 0.0.7&#39;
gem 'capistrano-rails', '~&gt; 0.0.7'
end</code></pre>
</div>
@ -312,9 +312,9 @@ part, to get the best, and most sensible results, simply <code>require</code> th
files:</p>
<div>
<pre data-line=''><code class='language-ruby'>require &#39;capistrano/rails/assets&#39;
require &#39;capistrano/rails/gem-bundler&#39;
require &#39;capistrano/rails/database-migrations&#39;</code></pre>
<pre data-line=''><code class='language-ruby'>require 'capistrano/rails/assets'
require 'capistrano/rails/gem-bundler'
require 'capistrano/rails/database-migrations'</code></pre>
</div>
<div class="alert alert-info">
@ -325,7 +325,7 @@ by mistake, then you can lock your Gem version for Capistrano at something
like:
<div>
<pre data-line=''><code class='language-ruby'>gem &#39;capistrano&#39;, &#39;~&gt; 2.15&#39; # Or whatever patch release you are using</code></pre>
<pre data-line=''><code class='language-ruby'>gem 'capistrano', '~&gt; 2.15' # Or whatever patch release you are using</code></pre>
</div>
<p>This is the <a href="http://docs.rubygems.org/read/chapter/16#page74">pessimistic operator</a> which

View file

@ -212,7 +212,7 @@ role :db, %w{example.com}
# definition into the server list. The second argument
# is something that quacks like a hash and can be used
# to set extended properties on the server.
server &#39;example.com&#39;, roles: %w{web app}, my_property: :my_value
server 'example.com', roles: %w{web app}, my_property: :my_value
# set :rails_env, :staging</code></pre>
</div>
@ -237,8 +237,8 @@ server line after the comment:</p>
<div>
<pre data-line=''><code class='language-ruby'>role :all, %w{hello@world.com example.com:1234}
# ...is the same as doing...
server &#39;world.com&#39; roles: [:web], user: &#39;hello&#39;
server &#39;example.com&#39;, roles: [:web], port: 1234</code></pre>
server 'world.com' roles: [:web], user: 'hello'
server 'example.com', roles: [:web], port: 1234</code></pre>
</div>
<h3 id="toc_4">5. Set the shared information in <code>deploy.rb</code>.</h3>
@ -252,8 +252,8 @@ self-documenting, commented-out configuration options, feel free to play with
them a little:</p>
<div>
<pre data-line=''><code class='language-ruby'>set :application, &#39;my app name&#39;
set :repo_url, &#39;git@example.com:me/my_repo.git&#39;
<pre data-line=''><code class='language-ruby'>set :application, 'my app name'
set :repo_url, 'git@example.com:me/my_repo.git'
ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }</code></pre>
</div>
@ -275,9 +275,9 @@ forked to the Capistrano repository, but you can find the (unchanged) original
<a href="https://github.com/RailsApps/rails3-bootstrap-devise-cancan">here</a>.</p>
<div>
<pre data-line=''><code class='language-ruby'>set :application, &#39;rails3-bootstrap-devise-cancan-demo&#39;
set :repo_url, &#39;https://github.com/capistrano/rails3-bootstrap-devise-cancan&#39;
set :branch, &#39;master&#39;</code></pre>
<pre data-line=''><code class='language-ruby'>set :application, 'rails3-bootstrap-devise-cancan-demo'
set :repo_url, 'https://github.com/capistrano/rails3-bootstrap-devise-cancan'
set :branch, 'master'</code></pre>
</div>
<p>I&#39;ve simplified the <code>:branch</code> variable to simply be a <code>set</code> variable, not a
@ -404,7 +404,7 @@ role :db, %w{example.com}
# definition into the server list. The second argument
# is something that quacks like a hash and can be used
# to set extended properties on the server.
server &#39;example.com&#39;, roles: %w{web app}, my_property: :my_value
server 'example.com', roles: %w{web app}, my_property: :my_value
# set :rails_env, :staging</code></pre>
</div>
@ -429,8 +429,8 @@ server line after the comment:</p>
<div>
<pre data-line=''><code class='language-ruby'>role :all, %w{hello@world.com example.com:1234}
# ...is the same as doing...
server &#39;world.com&#39; roles: [:web], user: &#39;hello&#39;
server &#39;example.com&#39;, roles: [:web], port: 1234</code></pre>
server 'world.com' roles: [:web], user: 'hello'
server 'example.com', roles: [:web], port: 1234</code></pre>
</div>
<h3 id="toc_4">5. Set the shared information in <code>deploy.rb</code>.</h3>
@ -444,8 +444,8 @@ self-documenting, commented-out configuration options, feel free to play with
them a little:</p>
<div>
<pre data-line=''><code class='language-ruby'>set :application, &#39;my app name&#39;
set :repo_url, &#39;git@example.com:me/my_repo.git&#39;
<pre data-line=''><code class='language-ruby'>set :application, 'my app name'
set :repo_url, 'git@example.com:me/my_repo.git'
ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }</code></pre>
</div>
@ -467,9 +467,9 @@ forked to the Capistrano repository, but you can find the (unchanged) original
<a href="https://github.com/RailsApps/rails3-bootstrap-devise-cancan">here</a>.</p>
<div>
<pre data-line=''><code class='language-ruby'>set :application, &#39;rails3-bootstrap-devise-cancan-demo&#39;
set :repo_url, &#39;https://github.com/capistrano/rails3-bootstrap-devise-cancan&#39;
set :branch, &#39;master&#39;</code></pre>
<pre data-line=''><code class='language-ruby'>set :application, 'rails3-bootstrap-devise-cancan-demo'
set :repo_url, 'https://github.com/capistrano/rails3-bootstrap-devise-cancan'
set :branch, 'master'</code></pre>
</div>
<p>I&#39;ve simplified the <code>:branch</code> variable to simply be a <code>set</code> variable, not a

View file

@ -217,7 +217,7 @@ task :ditty do
# we can reflect on the `host` object passed to the block
# and use the `info` logger method to benefit from the
# output formatter that is selected.
uptime = capture(&#39;uptime&#39;)
uptime = capture('uptime')
if host.roles.include?(:web)
info &quot;Your webserver #{host} has uptime: #{uptime}&quot;
end
@ -228,8 +228,8 @@ task :ditty do
# and move the process into a directoy, executing arbitrary tasks
# such as letting Rails do some heavy lifting.
with({:rails_env =&gt; :production}) do
within(&#39;/var/www/my/rails/app&#39;) do
execute :rails, :runner, &#39;MyModel.something&#39;
within('/var/www/my/rails/app') do
execute :rails, :runner, 'MyModel.something'
end
end
end
@ -238,8 +238,8 @@ task :ditty do
# We can even switch users, provided we have support on the remote
# server for switching to that user without being prompted for a
# passphrase.
as &#39;postgres&#39; do
widgets = capture &quot;echo &#39;SELECT * FROM widgets;&#39; | psql my_database&quot;
as 'postgres' do
widgets = capture &quot;echo 'SELECT * FROM widgets;' | psql my_database&quot;
if widgets.to_i &lt; 50
warn &quot;There are fewer than 50 widgets in the database on #{host}!&quot;
end
@ -249,7 +249,7 @@ task :ditty do
on roles(:all) do
# We can even use `test` the way the Unix gods intended
if test(&quot;[ -d /some/directory ]&quot;)
info &quot;Phew, it&#39;s ok, the directory exists!&quot;
info &quot;Phew, it's ok, the directory exists!&quot;
end
end
@ -373,7 +373,7 @@ task :ditty do
# we can reflect on the `host` object passed to the block
# and use the `info` logger method to benefit from the
# output formatter that is selected.
uptime = capture(&#39;uptime&#39;)
uptime = capture('uptime')
if host.roles.include?(:web)
info &quot;Your webserver #{host} has uptime: #{uptime}&quot;
end
@ -384,8 +384,8 @@ task :ditty do
# and move the process into a directoy, executing arbitrary tasks
# such as letting Rails do some heavy lifting.
with({:rails_env =&gt; :production}) do
within(&#39;/var/www/my/rails/app&#39;) do
execute :rails, :runner, &#39;MyModel.something&#39;
within('/var/www/my/rails/app') do
execute :rails, :runner, 'MyModel.something'
end
end
end
@ -394,8 +394,8 @@ task :ditty do
# We can even switch users, provided we have support on the remote
# server for switching to that user without being prompted for a
# passphrase.
as &#39;postgres&#39; do
widgets = capture &quot;echo &#39;SELECT * FROM widgets;&#39; | psql my_database&quot;
as 'postgres' do
widgets = capture &quot;echo 'SELECT * FROM widgets;' | psql my_database&quot;
if widgets.to_i &lt; 50
warn &quot;There are fewer than 50 widgets in the database on #{host}!&quot;
end
@ -405,7 +405,7 @@ task :ditty do
on roles(:all) do
# We can even use `test` the way the Unix gods intended
if test(&quot;[ -d /some/directory ]&quot;)
info &quot;Phew, it&#39;s ok, the directory exists!&quot;
info &quot;Phew, it's ok, the directory exists!&quot;
end
end