-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
330 lines (301 loc) · 9.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Continuous Delivery with Capistrano</title>
<meta property="og:image" content="http://ujjwalojha.com.np/capistrano-presentation/img/opengraph-preview.png" />
<meta property="og:author" content="https://www.facebook.com/ojhaujjwal"/>
<meta name="description" content="Continuous Delivery with Capistrano">
<meta name="author" content="Ujjwal OJha">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="bower_components/reveal.js/css/reveal.css">
<link rel="stylesheet" href="bower_components/reveal.js/css/theme/black.css" id="theme">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="bower_components/reveal.js/lib/css/zenburn.css">
<style type="text/css">
.reveal section img {
border: 0;
background: none;
box-shadow: 0 0 #000;
}
.reveal section h2, .reveal section h3 {
text-transform: none;
}
.reveal pre {
box-shadow: none;
}
.reveal pre code {
max-height: none;
max-width: none;
}
</style>
<!-- Printing and PDF exports -->
<script>
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'bower_components/reveal.js/css/print/'
+ (window.location.search.match(/print-pdf/gi) ? 'pdf.css' : 'paper.css');
document.getElementsByTagName('head')[0].appendChild(link);
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h2>Continuous Delivery</h2>
<p>With Capistrano</p>
</section>
<section>
<h2>
<a href="http://twitter.com/ojhaujjwal" target="_blank">Ujjwal Ojha</a>
</h2>
</section>
<section>
<h2>
<img
src="img/gh.svg"
alt="Me on Github"
height="70px"
style="margin: 0;"
/>
<img
src="img/twitter.svg"
alt="Me on Twitter"
height="70px"
style="margin: 0;"
/>
<a href="http://twitter.com/ojhaujjwal" target="_blank">ojhaujjwal</a>
</h2>
</section>
<section data-background="#dddddd">
<img src="img/introcept-global-logo.png" class="Introcept Logo">
</section>
<section>
<section>
<h3>Continuous Delivery</h3>
<ul>
<li>Frequent releases in short cycles</li>
<li class="fragment">practice of using automation to release software in short iterations</li>
<li class="fragment">Goal to achieve minimal downtime and frequent updates</li>
<li class="fragment">and satisfy the custom through early and <b>continuous delivery</b> of valuable software.</li>
</ul>
</section>
<section>
<h3>Zero Downtime Deployment</h3>
<ul>
<li>Bringing frequent updates to your websites/web applications</li>
<li class="fragment">Without the annoying message "Site currently under maintainance"</li>
</ul>
</section>
<section>
<img src="img/waiting.png" alt="User Waiting"/>
</section>
</section>
<section>
<section>
<h3>A little background on traditional deployment techniques</h3>
</section>
<section>
<img src="img/ftp.jpg" alt="FTP deployment">
</section>
<section>
<h3>Manual deployment</h3>
<ul>
<li>SSH to the server</li>
<li class="fragment">git pull manually</li>
<li class="fragment">and maybe manually run "npm install"</li>
</ul>
</section>
</section>
<section>
<section>
<h3>Capistrano</h3>
<p class="fragment">Automating scripts on one or many servers.</p>
<p class="fragment">Automating process of releasing new version of an application.</p>
<p class="fragment">Capistrano is a ruby gem. But, it can be used to deploy application of any language.</p>
</section>
<section>
<h3>How does it work?</h3>
<ul>
<li class="fragment">No software installed on server<span class="fragment">(except Git/SVN)</span></li>
<li class="fragment">"gem install capistrano" on local machine.</li>
<li class="fragment">Executes a series of commands on a remote machine via SSH.</li>
</ul>
</section>
<section>
<h3>Release process</h3>
<ul>
<li>Download latest code from repository</li>
<li class="fragment">Perform pre and post-deploy functions</li>
<li class="fragment">like restarting web server, refreshing cache, running db migrations etc</li>
<li class="fragment">Publishes the new version on deployment success</li>
</ul>
</section>
<section>
<h3>Instant rollback</h3>
<p class="fragment">Maintains multiple releases directory.</p>
<p class="fragment">Application can be easily rolled back to the previous version.</p>
</section>
<section>
<h3>Directory structure</h3>
<pre>
<code>
app
├──releases
│ ├── 20150080072500
│ ├── 20150090083000
│ ├── 20150100093500
│ ├── 20150110104000
│ └── 20150120114500
│ ├── checked out files from Git repository
│ └── config
│ ├── db.yml->/var/www/app/shared/config/db.yml
│ └── secret.yml->/var/www/app/shared/config/secret.yml
│
├──current -> /var/www/myapp/releases/20150120114500/
├──repo
│ └── VCS related data
└──shared
├── linked_files and linked_dirs
└── config
├── db.yml
└── secret.yml
</code>
</pre>
</section>
</section>
<section>
<h2>Demo Time. Hurray!</h2>
<p>Demo Repo: <a href="http://bit.ly/2gMbkNg" target="_blank
">http://bit.ly/2gMbkNg</a></p>
</section>
<section>
<h3>Deployment Flow</h3>
<pre>
<code>
deploy:starting - start a deployment
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>
</section>
<section>
<section>
<h3>Installation</h3>
<p>gem install capistrano</p>
<p><b>Deploy using:</b> cap production deploy</p>
</section>
<section>
<h3>Sample Capfile</h3>
<pre>
<code>
set :deploy_config_path, 'cap/deploy.rb'
set :stage_config_path, 'cap/stages'
require "capistrano/setup"
require "capistrano/deploy"
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/passenger'
# Load custom tasks from `cap/tasks/tasks` if you have any defined
Dir.glob('cap/tasks/*.rake').each { |r| import r }
</code>
</pre>
</section>
<section>
<h3>Sample configuration</h3>
<pre>
<code>
set :application, 'my_app_name'
set :repo_url, 'git@example.com:me/my_repo.git'
set :deploy_to, '/var/www/app'
set :linked_files, ['config/database.yml', 'config/secrets.yml']
set :linked_dirs, ['tmp/session', 'tmp/cache', 'backups']
namespace :deploy do
after :updated, "composer:install"
after :updated, "bower:install"
after :finished, "reload:nginx"
after :finished, "notify:finish"
after :failed, "notify:failure"
end
</code>
</pre>
</section>
<section>
<h3>Sample stage configuration</h3>
<pre>
<code>
server 'server-ip-here',
roles: %w{web app},
user: 'root',
port: 22
set :env, 'production'
set :deploy_to, "/var/www/app"
</code>
</pre>
</section>
</section>
<section>
<h2>Thank you!</h2>
<h2>Any Questions?</h2>
</section>
<section>
<h2><img src="img/introcept-vacancy.png" alt="Introcept Vacancy"/></h2>
</section>
</div>
</div>
<script src="bower_components/headjs/dist/1.0.0/head.min.js"></script>
<script src="bower_components/reveal.js/js/reveal.js"></script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // none/fade/slide/convex/concave/zoom
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{
src: 'bower_components/reveal.js/lib/js/classList.js',
condition: function () {
return !document.body.classList;
}
},
{
src: 'bower_components/reveal.js/plugin/markdown/marked.js',
condition: function () {
return !!document.querySelector('[data-markdown]');
}
},
{
src: 'bower_components/reveal.js/plugin/markdown/markdown.js',
condition: function () {
return !!document.querySelector('[data-markdown]');
}
},
{
src: 'bower_components/reveal.js/plugin/highlight/highlight.js',
async: true,
callback: function () {
hljs.initHighlightingOnLoad();
}
},
{src: 'bower_components/reveal.js/plugin/zoom-js/zoom.js', async: true},
{src: 'bower_components/reveal.js/plugin/notes/notes.js', async: true}
],
keyboard: {
39: 'next',
37: 'prev'
}
});
</script>
</body>
</html>