-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploying_rails.html
More file actions
475 lines (461 loc) · 24.7 KB
/
deploying_rails.html
File metadata and controls
475 lines (461 loc) · 24.7 KB
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
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
<!doctype html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Deploying Rails — Ruby on Rails Guides</title>
<link rel="stylesheet" type="text/css" href="stylesheets/style.css" data-turbo-track="reload">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<link rel="stylesheet" type="text/css" href="stylesheets/highlight.css" data-turbo-track="reload">
<link rel="icon" href="images/backend-development.svg" sizes="any">
<script src="javascripts/@hotwired--turbo.js" data-turbo-track="reload"></script>
<script src="javascripts/clipboard.js" data-turbo-track="reload"></script>
<script src="javascripts/guides.js" data-turbo-track="reload"></script>
<meta property="og:title" content="Deploying Rails — Ruby on Rails Guides" />
<meta name="description" content="Deploying RailsYour "Minimal Viable Product" is finished, now you want to publish it on the web.After working through this guide you should be able to deploy a rails app to dokku (or heroku) using git deploy a rails app to any unix server using capistrano" />
<meta property="og:description" content="Deploying RailsYour "Minimal Viable Product" is finished, now you want to publish it on the web.After working through this guide you should be able to deploy a rails app to dokku (or heroku) using git deploy a rails app to any unix server using capistrano" />
<meta property="og:locale" content="en_US" />
<meta property="og:site_name" content="Textbook Backend Developemnt" />
<meta property="og:image" content="images/backend-development.svg" />
<meta property="og:type" content="website" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100..900&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Heebo:wght@100..900&family=Noto+Sans+Arabic:wght@100..900&display=swap" rel="stylesheet">
<meta name="theme-color" content="#2e56e9">
</head>
<body class="guide">
<header id="page_header">
<div class="wrapper clearfix">
<nav id="feature_nav">
<div class="header-logo">
<a href="/">Backend Development</a>
</div>
<ul class="nav">
<li><a class="nav-item" id="home_nav" href="/">Home</a></li>
<li class="guides-index guides-index-large">
<a href="index.html" id="guidesMenu" class="guides-index-item nav-item">Index</a>
<div id="guides" class="clearfix" style="display: none;">
<hr />
<dl class="guides-section-container">
<div class="guides-section">
<dt>Ruby on Rails</dt>
<dd><a href="ruby_commandline.html">Ruby Commandline</a></dd>
<dd><a href="rails_database_and_model.html">Models and ActiveRecord</a></dd>
<dd><a href="rails_db.html">Database and Migrations</a></dd>
<dd><a href="rails_associations_and_validations.html">Associations and Validations</a></dd>
<dd><a href="rails_view_and_controller.html">Routing, View and Controller</a></dd>
<dd><a href="rails_authentication.html">Simple Authentication</a></dd>
<dd><a href="assets_and_import_map.html">The Asset Pipeline and Importmaps</a></dd>
<dd><a href="testing.html">Getting started with Testing</a></dd>
<dd><a href="refactoring_rails.html">Refactoring Rails</a></dd>
<dd><a href="deploy-to-paas.html">Deploy to PAAS</a></dd>
<dd><a href="rails_gems.html">Ruby Gems for your Rails Project</a></dd>
<dd><a href="deploying_rails.html">Deploying Rails</a></dd>
</div>
<div class="guides-section">
<dt>Ruby on Rails - Advanced Topics</dt>
<dd><a href="deploy-to-paas.html">Deploy to PAAS</a></dd>
<dd><a href="rest-api.html">REST API</a></dd>
<dd><a href="graphql-api.html">GraphQL API</a></dd>
<dd><a href="rails_websockets.html">Websocket in Rails</a></dd>
<dd><a href="jobs_and_tasks.html">Jobs and Tasks in Rails</a></dd>
<dd><a href="rails_security.html">Rails Security</a></dd>
</div>
<div class="guides-section">
<dt>Overarching Concerns</dt>
<dd><a href="issue.html">Issue Lifecycle</a></dd>
<dd><a href="security.html">Security</a></dd>
<dd><a href="adv_authentication.html">Advanced Authentication</a></dd>
<dd><a href="caching.html">Caching</a></dd>
<dd><a href="advanced_testing.html">Advanced Testing</a></dd>
<dd><a href="internationalization.html">Internationalization (I18n)</a></dd>
<dd><a href="git_rebasing.html">Git Rebasing</a></dd>
</div>
<div class="guides-section">
<dt>Nodes.js</dt>
<dd><a href="node_vs_rails.html">Node vs. Rails</a></dd>
<dd><a href="node_basics.html">Node Basics</a></dd>
<dd><a href="node_websockets.html">Node Websockets</a></dd>
<dd><a href="node_express.html">Node Web App</a></dd>
<dd><a href="node_cluster.html">Scaling Node</a></dd>
</div>
<div class="guides-section">
<dt>Next.js</dt>
<dd><a href="nextjs.html">Next.js</a></dd>
</div>
</dl>
</div>
</li>
<li class="guides-index guides-index-small">
<select class="guides-index-item nav-item">
<option value="index.html">Index</option>
<optgroup label="Ruby on Rails">
<option value="ruby_commandline.html">Ruby Commandline</option>
<option value="rails_database_and_model.html">Models and ActiveRecord</option>
<option value="rails_db.html">Database and Migrations</option>
<option value="rails_associations_and_validations.html">Associations and Validations</option>
<option value="rails_view_and_controller.html">Routing, View and Controller</option>
<option value="rails_authentication.html">Simple Authentication</option>
<option value="assets_and_import_map.html">The Asset Pipeline and Importmaps</option>
<option value="testing.html">Getting started with Testing</option>
<option value="refactoring_rails.html">Refactoring Rails</option>
<option value="deploy-to-paas.html">Deploy to PAAS</option>
<option value="rails_gems.html">Ruby Gems for your Rails Project</option>
<option value="deploying_rails.html">Deploying Rails</option>
</optgroup>
<optgroup label="Ruby on Rails - Advanced Topics">
<option value="deploy-to-paas.html">Deploy to PAAS</option>
<option value="rest-api.html">REST API</option>
<option value="graphql-api.html">GraphQL API</option>
<option value="rails_websockets.html">Websocket in Rails</option>
<option value="jobs_and_tasks.html">Jobs and Tasks in Rails</option>
<option value="rails_security.html">Rails Security</option>
</optgroup>
<optgroup label="Overarching Concerns">
<option value="issue.html">Issue Lifecycle</option>
<option value="security.html">Security</option>
<option value="adv_authentication.html">Advanced Authentication</option>
<option value="caching.html">Caching</option>
<option value="advanced_testing.html">Advanced Testing</option>
<option value="internationalization.html">Internationalization (I18n)</option>
<option value="git_rebasing.html">Git Rebasing</option>
</optgroup>
<optgroup label="Nodes.js">
<option value="node_vs_rails.html">Node vs. Rails</option>
<option value="node_basics.html">Node Basics</option>
<option value="node_websockets.html">Node Websockets</option>
<option value="node_express.html">Node Web App</option>
<option value="node_cluster.html">Scaling Node</option>
</optgroup>
<optgroup label="Next.js">
<option value="nextjs.html">Next.js</option>
</optgroup>
</select>
</li>
</ul>
</nav>
</div>
</header>
<hr class="hide" />
<section id="feature">
<div class="wrapper">
<h1>Deploying Rails</h1><p>Your "Minimal Viable Product" is finished, now you
want to publish it on the web.</p><p>After working through this guide you should be able to</p>
<ul>
<li>deploy a rails app to dokku (or heroku) using git</li>
<li>deploy a rails app to any unix server using capistrano</li>
</ul>
<nav id="subCol">
<h3 class="chapter">
<picture>
<!-- Using the `source` HTML tag to set the dark theme image -->
<source
srcset="images/icon_book-close-bookmark-1-wht.svg"
media="(prefers-color-scheme: dark)"
/>
<img src="images/icon_book-close-bookmark-1.svg" alt="Chapter Icon" />
</picture>
Chapters
</h3>
<ol class="chapters">
<li><a href="#deploying-with-git">Deploying with git</a></li>
<li><a href="#public-key-authentication-in-ssh">Public Key Authentication in SSH</a>
<ul>
<li><a href="#deploying-with-a-deploy-user">deploying with a deploy-user</a></li>
<li><a href="#authorized-keys2">authorized_keys2</a></li>
</ul></li>
<li><a href="#how-to-run-rails">How to run Rails</a>
<ul>
<li><a href="#webrick">WEBrick</a></li>
<li><a href="#mod-passenger">mod_passenger</a></li>
</ul></li>
<li><a href="#deploying-with-capistrano">Deploying with Capistrano</a>
<ul>
<li><a href="#warning">WARNING</a></li>
<li><a href="#capistrano-assumptions">capistrano assumptions</a></li>
<li><a href="#how-to-install">how to install</a></li>
<li><a href="#configuration-in-config-deploy-rb">configuration in <code>config/deploy.rb</code></a></li>
<li><a href="#example-task-in-capfile">example task in Capfile</a></li>
<li><a href="#prepare-capistranoe">prepare capistranoe</a></li>
<li><a href="#run-a-capistrano-task">run a capistrano task</a></li>
<li><a href="#capistrano-folders">capistrano folders</a></li>
<li><a href="#my-first-deploy">my first deploy</a></li>
</ul></li>
</ol>
</nav>
<hr>
</div>
</section>
<main id="container">
<div class="wrapper">
<div id="mainCol">
<div class='slide'>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-0' href='slides_deploying_rails.html#/0'>◻</a></p>
<h2 id="deploying-with-git"><a class="anchorlink" href="#deploying-with-git"><span>1</span> Deploying with git</a></h2><p>heroku is one "Platform as a Service" provider that offers
to host your rails app. Heroku uses git to push the code to
the production server.</p><p>(See also
<a href="http://railsbridge.projects.multimediatechnology.at/installfest/create_a_heroku_account">Railsbridge Installfest: Create A Heroku Account</a>
and
<a href="https://railsbridge.projects.multimediatechnology.at/installfest/deploy_a_rails_app">Railsbridge Installfest: Deploy A Rails App</a>
)</p>
<ul>
<li>create an account on <a href="https://heroku.com">https://heroku.com</a></li>
<li>add your public key to your heroku account</li>
<li>install the heroku toolbelt on your local development machine</li>
</ul>
<p>in your rails app, which is already using git:</p>
<ul>
<li>heroku create</li>
<li>make some changes in the Gemfile (rubyracer, pg instead of sqlite)</li>
<li>don't forget to commit all changes!</li>
<li>git push heroku master</li>
<li>heroku run rake db:migrate</li>
<li>heroku open</li>
<li>heroku logs</li>
</ul>
<p>That's it. You should now have an app with a very strange URL, like
<a href="http://mighty-shore-1497.herokuapp.com/">http://mighty-shore-1497.herokuapp.com/</a></p></div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-1' href='slides_deploying_rails.html#/1'>◻</a></p>
<h2 id="public-key-authentication-in-ssh"><a class="anchorlink" href="#public-key-authentication-in-ssh"><span>2</span> Public Key Authentication in SSH</a></h2><p>(See also <a href="http://railsbridge.projects.multimediatechnology.at/installfest/create_an_ssh_key">Railsbridge Installfest</a>)</p><p><img src="images/public_key_crypto.svg" alt="public key login"></p>
<ul>
<li><a href="https://dougvitale.wordpress.com/2012/02/20/ssh-the-secure-shell/">learn about ssh</a></li>
<li>if you have a public + private key pair
<ul>
<li><code>id_rsa</code></li>
<li><code>id_rsa.pub</code></li>
</ul></li>
<li>and your private key is on your local computer
<ul>
<li>stored in <code>~/.ssh/id_rsa</code></li>
</ul></li>
<li>and your public key is on the server
<ul>
<li>stored in <code>~/.ssh/authorized_keys2</code></li>
</ul></li>
<li>then ssh will let you log in without giving a password</li>
</ul>
<p><img src="images/ssh_login_with_public_key.svg" alt="public key login"></p></div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-2' href='slides_deploying_rails.html#/2'>◻</a></p>
<h3 id="deploying-with-a-deploy-user"><a class="anchorlink" href="#deploying-with-a-deploy-user"><span>2.1</span> deploying with a deploy-user</a></h3>
<ul>
<li>alice and bob both want to deploy project x</li>
<li><code>deploy_x</code> is set up as an account on the server</li>
<li>alice adds her public key to <code>~deploy_x/.ssh/authorized_keys2</code></li>
<li>bob adds his public key to <code>~deploy_x/.ssh/authorized_keys2</code></li>
<li>both can deploy (from different machines) using the same capistrano setup</li>
</ul>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-3' href='slides_deploying_rails.html#/3'>◻</a></p>
<h3 id="authorized-keys2"><a class="anchorlink" href="#authorized-keys2"><span>2.2</span> authorized_keys2</a></h3><div class="interstitial code">
<pre><code class="highlight plaintext">ssh-rsa AAAAB3NzaC...2EAAAABI== alice@fh-salzburg.ac.at
ssh-rsa AAAAB8NzaC...DVj3R4Ww== bob@fh-salzburg.ac.at
</code></pre>
<button class="clipboard-button" data-clipboard-text="ssh-rsa AAAAB3NzaC...2EAAAABI== alice@fh-salzburg.ac.at
ssh-rsa AAAAB8NzaC...DVj3R4Ww== bob@fh-salzburg.ac.at
">Copy</button>
</div>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-4' href='slides_deploying_rails.html#/4'>◻</a></p>
<h2 id="how-to-run-rails"><a class="anchorlink" href="#how-to-run-rails"><span>3</span> How to run Rails</a></h2>
<ul>
<li>WEBrick (built in web server)</li>
<li>apache/nginx + mod_passenger</li>
<li>apache/nginx + mod_passenger + capistrano</li>
</ul>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-5' href='slides_deploying_rails.html#/5'>◻</a></p>
<h3 id="webrick"><a class="anchorlink" href="#webrick"><span>3.1</span> WEBrick</a></h3>
<ul>
<li>rails s</li>
</ul>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-6' href='slides_deploying_rails.html#/6'>◻</a></p>
<h3 id="mod-passenger"><a class="anchorlink" href="#mod-passenger"><span>3.2</span> mod_passenger</a></h3>
<ul>
<li>install <a href="https://www.phusionpassenger.com/">mod_passenger</a></li>
<li>upload your code</li>
<li>create files not in git (e.g. database.yml)</li>
<li>apache config:
<ul>
<li>set <code>DocumentRoot</code> to <code>public/</code></li>
<li>set <code>RailsEnv production</code></li>
</ul></li>
<li>restart apache</li>
<li>if you change the code:
<ul>
<li>touch <code>tmp/restart.txt</code> to force reload of code</li>
</ul></li>
</ul>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-7' href='slides_deploying_rails.html#/7'>◻</a></p>
<h2 id="deploying-with-capistrano"><a class="anchorlink" href="#deploying-with-capistrano"><span>4</span> Deploying with Capistrano</a></h2><p><img src="images/capistrano-deploy.svg" alt="Deploying with Javascript"></p></div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-8' href='slides_deploying_rails.html#/8'>◻</a></p>
<h3 id="warning"><a class="anchorlink" href="#warning"><span>4.1</span> WARNING</a></h3>
<ul>
<li>capistrano is a command line tool</li>
<li>you need to read the output!</li>
<li>you need to read every line of the output!</li>
<li>you seriously need to read every line of the output!</li>
</ul>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-9' href='slides_deploying_rails.html#/9'>◻</a></p>
<h3 id="capistrano-assumptions"><a class="anchorlink" href="#capistrano-assumptions"><span>4.2</span> capistrano assumptions</a></h3>
<ul>
<li>You are using SSH to access your remote machines</li>
<li>your remote servers have a shell called sh</li>
<li>authentication through password or public key</li>
<li>Capistrano reads its instructions from a <code>capfile</code></li>
</ul>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-10' href='slides_deploying_rails.html#/10'>◻</a></p>
<h3 id="how-to-install"><a class="anchorlink" href="#how-to-install"><span>4.3</span> how to install</a></h3><div class="interstitial code">
<pre><code class="highlight sh"><span class="nv">$ </span><span class="nb">sudo gem install </span>capistrano
Fetching: capistrano-2.13.5.gem <span class="o">(</span>100%<span class="o">)</span>
Successfully installed capistrano-2.13.5
1 <span class="nb">gem </span>installed
<span class="nv">$ $ </span>cap <span class="nb">install
mkdir</span> <span class="nt">-p</span> config/deploy
create config/deploy.rb
create config/deploy/staging.rb
create config/deploy/production.rb
<span class="nb">mkdir</span> <span class="nt">-p</span> lib/capistrano/tasks
create Capfile
Capified
</code></pre>
<button class="clipboard-button" data-clipboard-text="$ sudo gem install capistrano
Fetching: capistrano-2.13.5.gem (100%)
Successfully installed capistrano-2.13.5
1 gem installed
$ $ cap install
mkdir -p config/deploy
create config/deploy.rb
create config/deploy/staging.rb
create config/deploy/production.rb
mkdir -p lib/capistrano/tasks
create Capfile
Capified
">Copy</button>
</div>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-11' href='slides_deploying_rails.html#/11'>◻</a></p>
<h3 id="configuration-in-config-deploy-rb"><a class="anchorlink" href="#configuration-in-config-deploy-rb"><span>4.4</span> configuration in <code>config/deploy.rb</code></a></h3><p>local information, see our wiki</p></div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-12' href='slides_deploying_rails.html#/12'>◻</a></p>
<h3 id="example-task-in-capfile"><a class="anchorlink" href="#example-task-in-capfile"><span>4.5</span> example task in Capfile</a></h3><div class="interstitial code">
<pre><code class="highlight ruby"><span class="n">task</span> <span class="ss">:display_free_disk_space</span> <span class="k">do</span>
<span class="n">run</span> <span class="s2">"df -h"</span>
<span class="k">end</span>
</code></pre>
<button class="clipboard-button" data-clipboard-text="task :display_free_disk_space do
run "df -h"
end
">Copy</button>
</div>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-13' href='slides_deploying_rails.html#/13'>◻</a></p>
<h3 id="prepare-capistranoe"><a class="anchorlink" href="#prepare-capistranoe"><span>4.6</span> prepare capistranoe</a></h3><div class="interstitial code">
<pre><code class="highlight sh"><span class="nv">$ </span>cap production <span class="nb">git</span>:check
<span class="nv">$ </span>scp config/database.yml deployuser@server:/var/www/.../shared/config
<span class="nv">$ </span>scp config/secrets.yml deployuser@server:/var/www/.../shared/config
<span class="nv">$ </span>cap production deploy
</code></pre>
<button class="clipboard-button" data-clipboard-text="$ cap production git:check
$ scp config/database.yml deployuser@server:/var/www/.../shared/config
$ scp config/secrets.yml deployuser@server:/var/www/.../shared/config
$ cap production deploy
">Copy</button>
</div>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-14' href='slides_deploying_rails.html#/14'>◻</a></p>
<h3 id="run-a-capistrano-task"><a class="anchorlink" href="#run-a-capistrano-task"><span>4.7</span> run a capistrano task</a></h3><div class="interstitial code">
<pre><code class="highlight sh"><span class="nv">$ </span>cap production deploy
<span class="nv">$ </span>cap display_free_disk_space
<span class="k">*</span> 2012-11-29 05:34:45 executing <span class="s1">'display_free_disk_space'</span>
<span class="k">*</span> executing <span class="s2">"df -h"</span>
servers: <span class="o">[</span><span class="s2">"multimediaart.at"</span><span class="o">]</span>
Password: <span class="k">****</span>
<span class="o">[</span>multimediaart.at] executing <span class="nb">command</span>
<span class="k">**</span> <span class="o">[</span>out :: multimediaart.at] Size Used Avail Use% Mounted on
<span class="k">**</span> <span class="o">[</span>out :: multimediaart.at] 98G 70G 24G 75% /var/www
<span class="nb">command </span>finished <span class="k">in </span>165ms
</code></pre>
<button class="clipboard-button" data-clipboard-text="$ cap production deploy
$ cap display_free_disk_space
* 2012-11-29 05:34:45 executing 'display_free_disk_space'
* executing "df -h"
servers: ["multimediaart.at"]
Password: ****
[multimediaart.at] executing command
** [out :: multimediaart.at] Size Used Avail Use% Mounted on
** [out :: multimediaart.at] 98G 70G 24G 75% /var/www
command finished in 165ms
">Copy</button>
</div>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-15' href='slides_deploying_rails.html#/15'>◻</a></p>
<h3 id="capistrano-folders"><a class="anchorlink" href="#capistrano-folders"><span>4.8</span> capistrano folders</a></h3><p>read the logfile, try to find out how capistrano lays out
the folders</p>
<ul>
<li>current --> links to a release</li>
<li>release
<ul>
<li>20121201113038</li>
<li>20121201150544</li>
</ul></li>
<li>shared
<ul>
<li>assets</li>
<li>bundle</li>
<li>log</li>
<li>pids</li>
<li>system</li>
</ul></li>
</ul>
</div>
<div class='slide'>
<p class='slide_break_block'><a class='slide_break' id='slide-16' href='slides_deploying_rails.html#/16'>◻</a></p>
<h3 id="my-first-deploy"><a class="anchorlink" href="#my-first-deploy"><span>4.9</span> my first deploy</a></h3><div class="interstitial code">
<pre><code class="highlight sh"><span class="nv">$ </span>cap deploy:setup
<span class="nv">$ </span>cap deploy:check
<span class="nv">$ </span>cap deploy:cold
<span class="nv">$ </span>cap deploy:upload <span class="nv">FILES</span><span class="o">=</span><span class="s1">'config/database.yml'</span>
</code></pre>
<button class="clipboard-button" data-clipboard-text="$ cap deploy:setup
$ cap deploy:check
$ cap deploy:cold
$ cap deploy:upload FILES='config/database.yml'
">Copy</button>
</div>
</div>
</div>
</div>
</main>
<hr class="hide" />
<footer id="page_footer">
<div class="wrapper">
<p class="copyright">published under <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/at/deed.de">creative commons by-nc-sa</a> in 2012-2025 by <a href="https://brigitte-jellinek.at">Brigitte Jellinek</a>.
</p>
<p>If you want to contribute: <a href="https://github.com/backend-development/backend-development-textbook/fork">fork the source on github</a>
</p>
<p>Favicon "backend development" by Arkinasi from <a href="https://thenounproject.com/browse/icons/term/backend-development/" target="_blank" title="backend development Icons">Noun Project</a> (CC BY 3.0)</p>
</div>
</footer>
</body>
</html>