mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Build the documentation from Huiming Teo's changes.
This commit is contained in:
parent
442fc2c03e
commit
4e5b4747de
1 changed files with 343 additions and 0 deletions
343
_site/documentation/getting-started/flow/index.html
Normal file
343
_site/documentation/getting-started/flow/index.html
Normal file
|
@ -0,0 +1,343 @@
|
|||
<!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>Flow</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="top-bar">
|
||||
<a href="/" class="brand">
|
||||
<img src="/images/CapistranoLogo.png" />
|
||||
</a>
|
||||
</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/v3/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/rollbacks/">Rollbacks</a></li>
|
||||
<li class="divider"></li>
|
||||
<h5>Framework Extensions</h5>
|
||||
<li><a href="/documentation/frameworks/ruby-on-rails/">Ruby on Rails</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>Flow</h2>
|
||||
<p>Capistrano v3 provides a default <strong>deploy flow</strong> and a <strong>rollback flow</strong>:</p>
|
||||
|
||||
<h3 id="toc_0">Deploy flow</h3>
|
||||
|
||||
<p>When you run <code>cap production deploy</code>, it invokes the following tasks in
|
||||
sequence:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">deploy:starting - start a deployment, make sure everything is ready
|
||||
deploy:started - started hook (for custom tasks)
|
||||
deploy:updating - update server(s) with a new release
|
||||
deploy:updated - updated hook
|
||||
deploy:publishing - publish the new release
|
||||
deploy:published - published hook
|
||||
deploy:finishing - finish the deployment, clean up everything
|
||||
deploy:finished - finished hook
|
||||
</code></pre></div>
|
||||
<p>Notice there are several hook tasks e.g. <code>:started</code>, <code>:updated</code> for
|
||||
you to hook up custom tasks into the flow using <code>after()</code> and <code>before()</code>.</p>
|
||||
|
||||
<h3 id="toc_1">Rollback flow</h3>
|
||||
|
||||
<p>When you run <code>cap production deploy:rollback</code>, it invokes the following
|
||||
tasks in sequence:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">deploy:starting
|
||||
deploy:started
|
||||
deploy:reverting - revert server(s) to previous release
|
||||
deploy:reverted - reverted hook
|
||||
deploy:publishing
|
||||
deploy:published
|
||||
deploy:finishing_rollback - finish the rollback, clean up everything
|
||||
deploy:finished
|
||||
</code></pre></div>
|
||||
<p>As you can see, rollback flow shares many tasks with deploy flow. But note that, rollback flow runs its own <code>:finishing_rollback</code> task because its
|
||||
cleanup process is usually different from deploy flow.</p>
|
||||
|
||||
<h3 id="toc_2">Flow examples</h3>
|
||||
|
||||
<p>Assume you require the following files in <code>Capfile</code>,</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text"># Capfile
|
||||
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 this following tasks:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">deploy
|
||||
deploy:starting
|
||||
[before]
|
||||
deploy:ensure_stage
|
||||
deploy:check
|
||||
deploy:started
|
||||
deploy:updating
|
||||
git:create_release
|
||||
deploy:symlink:shared
|
||||
deploy:updated
|
||||
[before]
|
||||
deploy:bundle
|
||||
[after]
|
||||
deploy:migrate
|
||||
deploy:compile_assets
|
||||
deploy:cleanup_assets
|
||||
deploy:normalise_assets
|
||||
deploy:publishing
|
||||
deploy:symlink:release
|
||||
deploy:restart
|
||||
deploy:published
|
||||
deploy:finishing
|
||||
deploy:cleanup
|
||||
deploy:finished
|
||||
deploy:log_revision
|
||||
</code></pre></div>
|
||||
<p>For <code>cap production deploy:rollback</code>, it runs these tasks:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">deploy
|
||||
deploy:starting
|
||||
[before]
|
||||
deploy:ensure_stage
|
||||
deploy:check
|
||||
deploy:started
|
||||
deploy:reverting
|
||||
deploy:revert_release
|
||||
deploy:reverted
|
||||
[after]
|
||||
deploy:rollback_assets
|
||||
deploy:publishing
|
||||
deploy:symlink:release
|
||||
deploy:restart
|
||||
deploy:published
|
||||
deploy:finishing_rollback
|
||||
deploy:cleanup_rollback
|
||||
deploy:finished
|
||||
deploy:log_revision
|
||||
</code></pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--<div class="container"> -->
|
||||
<!-- <h1 class="title"><a href="/">Capistrano</a></h1>-->
|
||||
<!-- <a class="extra" href="/">home</a> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- <p>Capistrano v3 provides a default <strong>deploy flow</strong> and a <strong>rollback flow</strong>:</p>
|
||||
|
||||
<h3 id="toc_0">Deploy flow</h3>
|
||||
|
||||
<p>When you run <code>cap production deploy</code>, it invokes the following tasks in
|
||||
sequence:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">deploy:starting - start a deployment, make sure everything is ready
|
||||
deploy:started - started hook (for custom tasks)
|
||||
deploy:updating - update server(s) with a new release
|
||||
deploy:updated - updated hook
|
||||
deploy:publishing - publish the new release
|
||||
deploy:published - published hook
|
||||
deploy:finishing - finish the deployment, clean up everything
|
||||
deploy:finished - finished hook
|
||||
</code></pre></div>
|
||||
<p>Notice there are several hook tasks e.g. <code>:started</code>, <code>:updated</code> for
|
||||
you to hook up custom tasks into the flow using <code>after()</code> and <code>before()</code>.</p>
|
||||
|
||||
<h3 id="toc_1">Rollback flow</h3>
|
||||
|
||||
<p>When you run <code>cap production deploy:rollback</code>, it invokes the following
|
||||
tasks in sequence:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">deploy:starting
|
||||
deploy:started
|
||||
deploy:reverting - revert server(s) to previous release
|
||||
deploy:reverted - reverted hook
|
||||
deploy:publishing
|
||||
deploy:published
|
||||
deploy:finishing_rollback - finish the rollback, clean up everything
|
||||
deploy:finished
|
||||
</code></pre></div>
|
||||
<p>As you can see, rollback flow shares many tasks with deploy flow. But note that, rollback flow runs its own <code>:finishing_rollback</code> task because its
|
||||
cleanup process is usually different from deploy flow.</p>
|
||||
|
||||
<h3 id="toc_2">Flow examples</h3>
|
||||
|
||||
<p>Assume you require the following files in <code>Capfile</code>,</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text"># Capfile
|
||||
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 this following tasks:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">deploy
|
||||
deploy:starting
|
||||
[before]
|
||||
deploy:ensure_stage
|
||||
deploy:check
|
||||
deploy:started
|
||||
deploy:updating
|
||||
git:create_release
|
||||
deploy:symlink:shared
|
||||
deploy:updated
|
||||
[before]
|
||||
deploy:bundle
|
||||
[after]
|
||||
deploy:migrate
|
||||
deploy:compile_assets
|
||||
deploy:cleanup_assets
|
||||
deploy:normalise_assets
|
||||
deploy:publishing
|
||||
deploy:symlink:release
|
||||
deploy:restart
|
||||
deploy:published
|
||||
deploy:finishing
|
||||
deploy:cleanup
|
||||
deploy:finished
|
||||
deploy:log_revision
|
||||
</code></pre></div>
|
||||
<p>For <code>cap production deploy:rollback</code>, it runs these tasks:</p>
|
||||
<div class="highlight"><pre><code class="text language-text" data-lang="text">deploy
|
||||
deploy:starting
|
||||
[before]
|
||||
deploy:ensure_stage
|
||||
deploy:check
|
||||
deploy:started
|
||||
deploy:reverting
|
||||
deploy:revert_release
|
||||
deploy:reverted
|
||||
[after]
|
||||
deploy:rollback_assets
|
||||
deploy:publishing
|
||||
deploy:symlink:release
|
||||
deploy:restart
|
||||
deploy:published
|
||||
deploy:finishing_rollback
|
||||
deploy:cleanup_rollback
|
||||
deploy:finished
|
||||
deploy:log_revision
|
||||
</code></pre></div> -->
|
||||
|
||||
<!--</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="/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>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue