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:
parent
781271c95c
commit
3f33beedb4
11 changed files with 98 additions and 96 deletions
2
Gemfile
2
Gemfile
|
@ -1,7 +1,7 @@
|
|||
source "https://rubygems.org"
|
||||
|
||||
gem "debugger"
|
||||
gem "jekyll"
|
||||
gem "jekyll", "~> 1.1.2"
|
||||
gem "redcarpet"
|
||||
gem "unindent"
|
||||
gem "git"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
source "https://rubygems.org"
|
||||
|
||||
gem "debugger"
|
||||
gem "jekyll"
|
||||
gem "jekyll", "~> 1.1.2"
|
||||
gem "redcarpet"
|
||||
gem "unindent"
|
||||
gem "git"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -170,9 +170,9 @@ what happens:</p>
|
|||
|
||||
<div>
|
||||
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote
|
||||
me@remote $ [[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'
|
||||
me@remote $ [[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'
|
||||
Interactive
|
||||
me@remote $ shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'
|
||||
me@remote $ shopt -q login_shell && 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 "[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'"
|
||||
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote "[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'"
|
||||
Interactive
|
||||
me@localhost $ ssh me@remote "shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'"
|
||||
me@localhost $ ssh me@remote "shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'"
|
||||
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 'me@remote' do
|
||||
info capture("[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'")
|
||||
on 'me@remote' do
|
||||
info capture("[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'")
|
||||
end
|
||||
end
|
||||
task :query_login do
|
||||
on 'me@remote' do
|
||||
info capture("shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'")
|
||||
on 'me@remote' do
|
||||
info capture("shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'")
|
||||
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* ]] && echo 'Interactive' || echo 'Not interactive'
|
||||
me@remote $ [[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'
|
||||
Interactive
|
||||
me@remote $ shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'
|
||||
me@remote $ shopt -q login_shell && 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 "[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'"
|
||||
<pre data-line=''><code class='language-bash'>me@localhost $ ssh me@remote "[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'"
|
||||
Interactive
|
||||
me@localhost $ ssh me@remote "shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'"
|
||||
me@localhost $ ssh me@remote "shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'"
|
||||
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 'me@remote' do
|
||||
info capture("[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'")
|
||||
on 'me@remote' do
|
||||
info capture("[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'")
|
||||
end
|
||||
end
|
||||
task :query_login do
|
||||
on 'me@remote' do
|
||||
info capture("shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'")
|
||||
on 'me@remote' do
|
||||
info capture("shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'")
|
||||
end
|
||||
end</code></pre>
|
||||
</div>
|
||||
|
|
|
@ -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 'me@my_email_address.com'</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'll be prompted for a passphrase, that'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 'hostname; uptime'
|
||||
<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 'ssh-add -l' didn'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 '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'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'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 'https://github.com': myownusername
|
||||
Password for 'https://capistrano@github.com':</code></pre>
|
||||
Username for 'https://github.com': myownusername
|
||||
Password for 'https://capistrano@github.com':</code></pre>
|
||||
</div>
|
||||
|
||||
<p>This challenge response prompt doesn'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 ':deploy_to' 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 'me@my_email_address.com'</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'll be prompted for a passphrase, that'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 'hostname; uptime'
|
||||
<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 'ssh-add -l' didn'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 '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'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'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 'https://github.com': myownusername
|
||||
Password for 'https://capistrano@github.com':</code></pre>
|
||||
Username for 'https://github.com': myownusername
|
||||
Password for 'https://capistrano@github.com':</code></pre>
|
||||
</div>
|
||||
|
||||
<p>This challenge response prompt doesn'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 ':deploy_to' 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}
|
||||
|
|
|
@ -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 'ls -lR /var/www/my-application'
|
||||
<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 'github.com,204.232.175.90' (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'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 'env | grep SSH_AUTH_SOCK'
|
||||
<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 'ls -lR /var/www/my-application'
|
||||
<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 'github.com,204.232.175.90' (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'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 'env | grep SSH_AUTH_SOCK'
|
||||
<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>
|
||||
|
||||
|
|
|
@ -155,11 +155,11 @@ cleanup process is usually different from deploy flow.</p>
|
|||
|
||||
<div>
|
||||
<pre data-line=''><code class='language-ruby'># Capfile
|
||||
require 'capistrano/setup'
|
||||
require 'capistrano/deploy'
|
||||
require 'capistrano/bundler'
|
||||
require 'capistrano/rails/migrations'
|
||||
require 'capistrano/rails/assets'</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 'capistrano/setup'
|
||||
require 'capistrano/deploy'
|
||||
require 'capistrano/bundler'
|
||||
require 'capistrano/rails/migrations'
|
||||
require 'capistrano/rails/assets'</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>
|
||||
|
|
|
@ -168,7 +168,7 @@ gems</a>)</p>
|
|||
|
||||
<div>
|
||||
<pre data-line=''><code class='language-ruby'>group :development do
|
||||
gem 'capistrano-rails', '~> 0.0.7'
|
||||
gem 'capistrano-rails', '~> 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 'capistrano/rails/assets'
|
||||
require 'capistrano/rails/gem-bundler'
|
||||
require 'capistrano/rails/database-migrations'</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 'capistrano', '~> 2.15' # Or whatever patch release you are using</code></pre>
|
||||
<pre data-line=''><code class='language-ruby'>gem 'capistrano', '~> 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 'capistrano-rails', '~> 0.0.7'
|
||||
gem 'capistrano-rails', '~> 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 'capistrano/rails/assets'
|
||||
require 'capistrano/rails/gem-bundler'
|
||||
require 'capistrano/rails/database-migrations'</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 'capistrano', '~> 2.15' # Or whatever patch release you are using</code></pre>
|
||||
<pre data-line=''><code class='language-ruby'>gem 'capistrano', '~> 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
|
||||
|
|
|
@ -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 'example.com', 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 'world.com' roles: [:web], user: 'hello'
|
||||
server 'example.com', 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, 'my app name'
|
||||
set :repo_url, 'git@example.com:me/my_repo.git'
|
||||
<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, 'rails3-bootstrap-devise-cancan-demo'
|
||||
set :repo_url, 'https://github.com/capistrano/rails3-bootstrap-devise-cancan'
|
||||
set :branch, 'master'</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'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 'example.com', 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 'world.com' roles: [:web], user: 'hello'
|
||||
server 'example.com', 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, 'my app name'
|
||||
set :repo_url, 'git@example.com:me/my_repo.git'
|
||||
<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, 'rails3-bootstrap-devise-cancan-demo'
|
||||
set :repo_url, 'https://github.com/capistrano/rails3-bootstrap-devise-cancan'
|
||||
set :branch, 'master'</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've simplified the <code>:branch</code> variable to simply be a <code>set</code> variable, not a
|
||||
|
|
|
@ -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('uptime')
|
||||
uptime = capture('uptime')
|
||||
if host.roles.include?(:web)
|
||||
info "Your webserver #{host} has uptime: #{uptime}"
|
||||
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 => :production}) do
|
||||
within('/var/www/my/rails/app') do
|
||||
execute :rails, :runner, 'MyModel.something'
|
||||
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 'postgres' do
|
||||
widgets = capture "echo 'SELECT * FROM widgets;' | psql my_database"
|
||||
as 'postgres' do
|
||||
widgets = capture "echo 'SELECT * FROM widgets;' | psql my_database"
|
||||
if widgets.to_i < 50
|
||||
warn "There are fewer than 50 widgets in the database on #{host}!"
|
||||
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("[ -d /some/directory ]")
|
||||
info "Phew, it's ok, the directory exists!"
|
||||
info "Phew, it's ok, the directory exists!"
|
||||
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('uptime')
|
||||
uptime = capture('uptime')
|
||||
if host.roles.include?(:web)
|
||||
info "Your webserver #{host} has uptime: #{uptime}"
|
||||
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 => :production}) do
|
||||
within('/var/www/my/rails/app') do
|
||||
execute :rails, :runner, 'MyModel.something'
|
||||
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 'postgres' do
|
||||
widgets = capture "echo 'SELECT * FROM widgets;' | psql my_database"
|
||||
as 'postgres' do
|
||||
widgets = capture "echo 'SELECT * FROM widgets;' | psql my_database"
|
||||
if widgets.to_i < 50
|
||||
warn "There are fewer than 50 widgets in the database on #{host}!"
|
||||
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("[ -d /some/directory ]")
|
||||
info "Phew, it's ok, the directory exists!"
|
||||
info "Phew, it's ok, the directory exists!"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue