質問編集履歴

8

情報追加

2017/01/28 01:47

投稿

s.k
s.k

スコア423

test CHANGED
File without changes
test CHANGED
@@ -332,26 +332,6 @@
332
332
 
333
333
  [deploy@tk2-241-30026 deploy]$ cd deploy
334
334
 
335
- [deploy@tk2-241-30026 deploy]$ cd deploy
336
-
337
- [deploy@tk2-241-30026 deploy]$ cd deploy
338
-
339
- [deploy@tk2-241-30026 deploy]$ cd deploy
340
-
341
- [deploy@tk2-241-30026 deploy]$ cd deploy
342
-
343
- [deploy@tk2-241-30026 deploy]$ cd deploy
344
-
345
- [deploy@tk2-241-30026 deploy]$ cd deploy
346
-
347
- [deploy@tk2-241-30026 deploy]$ cd deploy
348
-
349
- [deploy@tk2-241-30026 deploy]$ cd deploy
350
-
351
- [deploy@tk2-241-30026 deploy]$ cd deploy
352
-
353
- [deploy@tk2-241-30026 deploy]$ cd deploy
354
-
355
335
  ```
356
336
 
357
337
  ###補足情報(言語/FW/ツール等のバージョンなど)
@@ -376,7 +356,13 @@
376
356
 
377
357
 
378
358
 
359
+
360
+
361
+ staging.rbが二つありました。何か関係ありそうですね…
362
+
363
+
364
+
379
- 【staging.rb】
365
+ deploy/staging.rb】
380
366
 
381
367
  ```
382
368
 
@@ -399,3 +385,77 @@
399
385
  set :unicorn_exec, -> { "unicorn_rails" }
400
386
 
401
387
  ```
388
+
389
+
390
+
391
+ 【unicorn/staging.rb】
392
+
393
+
394
+
395
+ ```ここに言語を入力
396
+
397
+ base = "/home/deploy/staging"
398
+
399
+ current_path = "#{base}/current"
400
+
401
+ shared_path = "#{base}/shared"
402
+
403
+
404
+
405
+ worker_processes 2
406
+
407
+ preload_app true
408
+
409
+ timeout 30
410
+
411
+
412
+
413
+ stderr_path "#{current_path}/log/unicorn.stderr.log"
414
+
415
+ stdout_path "#{current_path}/log/unicorn.stdout.log"
416
+
417
+ listen "/tmp/unicorn.staging.sock"
418
+
419
+ pid "#{shared_path}/tmp/pids/unicorn.pid"
420
+
421
+
422
+
423
+ #ダウンタイム無し
424
+
425
+ preload_app true
426
+
427
+
428
+
429
+ before_fork do |server, worker|
430
+
431
+ ENV['BUNDLE_GEMFILE'] = File.expand_path('Gemfile', current_path)
432
+
433
+ old_pid = "#{server.config[:pid]}.oldbin"
434
+
435
+ if File.exists?(old_pid) && server.pid != old_pid
436
+
437
+ begin
438
+
439
+ sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
440
+
441
+ Process.kill(sig, File.read(old_pid).to_i)
442
+
443
+ rescue Errno::ENOENT, Errno::ESRCH
444
+
445
+ # someone else did our job for us
446
+
447
+ end
448
+
449
+ end
450
+
451
+ end
452
+
453
+
454
+
455
+ after_fork do |server, worker|
456
+
457
+ defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
458
+
459
+ end
460
+
461
+ ```

7

情報追加

2017/01/28 01:47

投稿

s.k
s.k

スコア423

test CHANGED
File without changes
test CHANGED
@@ -363,3 +363,39 @@
363
363
  Ubuntu
364
364
 
365
365
  Teraterm
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+ ###追加
374
+
375
+
376
+
377
+
378
+
379
+ 【staging.rb】
380
+
381
+ ```
382
+
383
+ set :pty, true
384
+
385
+ server 'xxx.xx.xxx.xx', user: 'deploy', roles: %w{app db web}
386
+
387
+
388
+
389
+ set :linked_dirs, %w{bin log tmp/backup tmp/pids tmp/sockets vendor/bundle}
390
+
391
+
392
+
393
+ shared_path = "/home/deploy/staging/shared"
394
+
395
+ set :unicorn_pid, "#{shared_path}/tmp/pids/unicorn.pid"
396
+
397
+ set :unicorn_options, -> { "--path /staging" }
398
+
399
+ set :unicorn_exec, -> { "unicorn_rails" }
400
+
401
+ ```

6

情報追加

2017/01/28 01:31

投稿

s.k
s.k

スコア423

test CHANGED
File without changes
test CHANGED
@@ -363,11 +363,3 @@
363
363
  Ubuntu
364
364
 
365
365
  Teraterm
366
-
367
-
368
-
369
- [マルチポストさせていただきました。](http://ja.stackoverflow.com/questions/32208/%E3%83%87%E3%83%97%E3%83%AD%E3%82%A4%E5%85%88%E3%81%AE%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%8C%E7%84%A1%E9%99%90%E3%81%AB%E5%AD%98%E5%9C%A8%E3%81%97%E3%81%BE%E3%81%99)
370
-
371
-
372
-
373
- 回答が付き次第反映させていただきます。

5

タグ追加

2017/01/27 15:23

投稿

s.k
s.k

スコア423

test CHANGED
File without changes
test CHANGED
File without changes

4

マルチポスト

2017/01/27 15:14

投稿

s.k
s.k

スコア423

test CHANGED
File without changes
test CHANGED
@@ -363,3 +363,11 @@
363
363
  Ubuntu
364
364
 
365
365
  Teraterm
366
+
367
+
368
+
369
+ [マルチポストさせていただきました。](http://ja.stackoverflow.com/questions/32208/%E3%83%87%E3%83%97%E3%83%AD%E3%82%A4%E5%85%88%E3%81%AE%E3%83%87%E3%82%A3%E3%83%AC%E3%82%AF%E3%83%88%E3%83%AA%E3%81%8C%E7%84%A1%E9%99%90%E3%81%AB%E5%AD%98%E5%9C%A8%E3%81%97%E3%81%BE%E3%81%99)
370
+
371
+
372
+
373
+ 回答が付き次第反映させていただきます。

3

情報追加

2017/01/27 14:25

投稿

s.k
s.k

スコア423

test CHANGED
File without changes
test CHANGED
@@ -274,6 +274,86 @@
274
274
 
275
275
  ```
276
276
 
277
+
278
+
279
+
280
+
281
+ 無限ではないんですがこんなにあります…
282
+
283
+ ```
284
+
285
+ [deploy@tk2-241-30026 deploy]$ cd deploy
286
+
287
+ [deploy@tk2-241-30026 deploy]$ cd deploy
288
+
289
+ [deploy@tk2-241-30026 deploy]$ cd deploy
290
+
291
+ [deploy@tk2-241-30026 deploy]$ cd deploy
292
+
293
+ [deploy@tk2-241-30026 deploy]$ cd deploy
294
+
295
+ [deploy@tk2-241-30026 deploy]$ cd deploy
296
+
297
+ [deploy@tk2-241-30026 deploy]$ cd deploy
298
+
299
+ [deploy@tk2-241-30026 deploy]$ cd deploy
300
+
301
+ [deploy@tk2-241-30026 deploy]$ cd deploy
302
+
303
+ [deploy@tk2-241-30026 deploy]$ cd deploy
304
+
305
+ [deploy@tk2-241-30026 deploy]$ cd deploy
306
+
307
+ [deploy@tk2-241-30026 deploy]$ cd deploy
308
+
309
+ [deploy@tk2-241-30026 deploy]$ cd deploy
310
+
311
+ [deploy@tk2-241-30026 deploy]$ cd deploy
312
+
313
+ [deploy@tk2-241-30026 deploy]$ cd deploy
314
+
315
+ [deploy@tk2-241-30026 deploy]$ cd deploy
316
+
317
+ [deploy@tk2-241-30026 deploy]$ cd deploy
318
+
319
+ [deploy@tk2-241-30026 deploy]$ cd deploy
320
+
321
+ [deploy@tk2-241-30026 deploy]$ cd deploy
322
+
323
+ [deploy@tk2-241-30026 deploy]$ cd deploy
324
+
325
+ [deploy@tk2-241-30026 deploy]$ cd deploy
326
+
327
+ [deploy@tk2-241-30026 deploy]$ cd deploy
328
+
329
+ [deploy@tk2-241-30026 deploy]$ cd deploy
330
+
331
+ [deploy@tk2-241-30026 deploy]$ cd deploy
332
+
333
+ [deploy@tk2-241-30026 deploy]$ cd deploy
334
+
335
+ [deploy@tk2-241-30026 deploy]$ cd deploy
336
+
337
+ [deploy@tk2-241-30026 deploy]$ cd deploy
338
+
339
+ [deploy@tk2-241-30026 deploy]$ cd deploy
340
+
341
+ [deploy@tk2-241-30026 deploy]$ cd deploy
342
+
343
+ [deploy@tk2-241-30026 deploy]$ cd deploy
344
+
345
+ [deploy@tk2-241-30026 deploy]$ cd deploy
346
+
347
+ [deploy@tk2-241-30026 deploy]$ cd deploy
348
+
349
+ [deploy@tk2-241-30026 deploy]$ cd deploy
350
+
351
+ [deploy@tk2-241-30026 deploy]$ cd deploy
352
+
353
+ [deploy@tk2-241-30026 deploy]$ cd deploy
354
+
355
+ ```
356
+
277
357
  ###補足情報(言語/FW/ツール等のバージョンなど)
278
358
 
279
359
  Rails5.0.0

2

情報追加

2017/01/27 13:56

投稿

s.k
s.k

スコア423

test CHANGED
@@ -1 +1 @@
1
- デプロイ先のディレクトリが無限に存在する件です。
1
+ デプロイ先のディレクトリが無限に存在しま
test CHANGED
File without changes

1

情報追加

2017/01/27 12:40

投稿

s.k
s.k

スコア423

test CHANGED
File without changes
test CHANGED
@@ -118,9 +118,161 @@
118
118
 
119
119
 
120
120
 
121
-
121
+ デプロイ時に表示された内容です。
122
+
122
-
123
+ ```
124
+
123
-
125
+ $ cap staging deploy
126
+
127
+ 00:00 git:wrapper
128
+
129
+ 01 mkdir -p /tmp
130
+
131
+ 01 bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
132
+
133
+ ✔ 01 deploy@xxx.xx.xxx.xx 0.599s
134
+
135
+ Uploading /tmp/git-ssh-third_app-staging-ubuntu.sh 100.0%
136
+
137
+ 02 chmod 700 /tmp/git-ssh-third_app-staging-ubuntu.sh
138
+
139
+ 02 bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
140
+
141
+ ✔ 02 deploy@xxx.xx.xxx.xx 0.149s
142
+
143
+ 00:01 git:check
144
+
145
+ 01 git ls-remote --heads ssh://git@bitbucket.org/sagaekeiga/third_app.git
146
+
147
+ 01 bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
148
+
149
+ 01 /bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
150
+
151
+ 01 f1fa9b57dc8683e2efce7c8eb03d224bebdb9a8f refs/heads/IndividualEvaluation
152
+
153
+ 01 bf3331afd60eed3c38ce042857632d9684cf8d47 refs/heads/SocialProfile
154
+
155
+ 01 13df3fec6c5fb2f69d0f2dc5f43bb0ceb5932e88 refs/heads/UI-1
156
+
157
+ 01 91678db69f43a1fd0693c3015e98e0fd5e4ca31f refs/heads/call
158
+
159
+ 01 a68f87b354fdf69404b73a9edac6928580e193dc refs/heads/cap
160
+
161
+ 01 e150cd8b4dd9bb4eb9d503eb191f9ed2f3e8c0b9 refs/heads/clip
162
+
163
+ 01 d398612c204ab6bec2b1844ee5a91c1fe3992519 refs/heads/comment
164
+
165
+ 01 ed11b1f282d81e03466edddc6c151e0c41db6001 refs/heads/demand
166
+
167
+ 01 46d626e46a3159de1b417d6e4b63e142eb424579 refs/heads/devise-strongparameters
168
+
169
+ 01 81947c39e6e62732f89966e500465e15cd92ea74 refs/heads/follow-shops-to-users
170
+
171
+ 01 f2cb5821c2dc96501b1739fa4dea2270ec39cdab refs/heads/follow-users-to-shop
172
+
173
+ 01 3e545daec4224b4441b6b76b6cabbb24112a000f refs/heads/following-shops
174
+
175
+ 01 d6a1dd6636b30c2007110386c18121e4000b80e6 refs/heads/following-shops-new
176
+
177
+ 01 7faf81d6534152ef505b66fe8329c53b2e2d73c0 refs/heads/following-users
178
+
179
+ 01 f311041927a9250f57828c054a29dbb87c3b68ea refs/heads/following-users-to-shop
180
+
181
+ 01 3ec55025f675fddfdb1443507b39acfb8ed56835 refs/heads/insist_shop-to-micropost.user
182
+
183
+ 01 5f0b0784e0d0e1baf038786fe2a8be94089715b4 refs/heads/like-shop
184
+
185
+ 01 7d3d18c80f9913a9e081fe61d791fbe8eb040f4f refs/heads/like-users-to-shop
186
+
187
+ 01 14b36068c5139fe0520b88ee7e56492a56ea20e2 refs/heads/liking-shops
188
+
189
+ 01 4bfb35a5a6192a2dca96695c72411ff735a4f39e refs/heads/liking-users
190
+
191
+ 01 be74a9312638eb02f935a11f297ab81a339b9486 refs/heads/mailer
192
+
193
+ 01 e04a5a001d123fbe48ac6034219ca6e291ff43d4 refs/heads/master
194
+
195
+ 01 de8224260bfc71f585b1f47ed8a8bb0a00809f84 refs/heads/messagebox
196
+
197
+ 01 338ea850c89dd09dbd9516fe47d36b41dc03cf72 refs/heads/micropost-partial
198
+
199
+ 01 93ab80c6a4ceb93033fc12ba58bc371cef4af316 refs/heads/micropost_partial_fusion
200
+
201
+ 01 962aced04ebf61068f8a3be4e42023bd2f4d7929 refs/heads/microposts-partial
202
+
203
+ 01 eaab87dc15b5586baf08ac38233a359f00c3d483 refs/heads/movie
204
+
205
+ 01 63da3a3c5f809ccdb53b52fc873d6b488285c489 refs/heads/my-new-feature
206
+
207
+ 01 eaab87dc15b5586baf08ac38233a359f00c3d483 refs/heads/rank
208
+
209
+ 01 983dc6e3373cfb755c852eb8f8662c13177e4d37 refs/heads/recruit
210
+
211
+ 01 4e5f7da406ca722aabe45a026853fdafb0b3fe1b refs/heads/request
212
+
213
+ 01 cecdfb261ea13a888a254692b2d2b605530447a2 refs/heads/say_shop-to-micropost.shop
214
+
215
+ 01 5f3fad920c15d9c45ee9eef673dd53475c18dfb9 refs/heads/search
216
+
217
+ 01 72c54307c0b3971c9984a1d15f47986bdfb5d959 refs/heads/shop-favorites-micropost
218
+
219
+ 01 3708d79eebf2bda7ec901e82c94847fe07a094c8 refs/heads/shop_controller
220
+
221
+ 01 6512361d20b307f0fab6b778ac97c2171da46979 refs/heads/shops-update-delete
222
+
223
+ 01 e23ca6174a237e88bbc3cfdb086930732ddd92a0 refs/heads/sign_up-login
224
+
225
+ 01 8a9cf90684498c85f098dcf50b0410a7cadf4b01 refs/heads/signup-login
226
+
227
+ 01 eaab87dc15b5586baf08ac38233a359f00c3d483 refs/heads/tag
228
+
229
+ 01 f755dcb002868f110eaa43a8d2c36bada93b00f2 refs/heads/test
230
+
231
+ 01 3e545daec4224b4441b6b76b6cabbb24112a000f refs/heads/testfile
232
+
233
+ 01 46cafea290ba59c58bf905b84967ab64fa7db853 refs/heads/updating-users
234
+
235
+ 01 0a76cc4a3900747a3422b96c1ed9d082a77fd0ad refs/heads/user-favorites-ajax
236
+
237
+ 01 72c54307c0b3971c9984a1d15f47986bdfb5d959 refs/heads/user-favorites-page
238
+
239
+ 01 338ea850c89dd09dbd9516fe47d36b41dc03cf72 refs/heads/user-shop-microposts
240
+
241
+ 01 b5c0f8d4c6610636243a5043432110867eb309b4 refs/heads/users-update-delete
242
+
243
+ 01 11db5c51f344d556a23119e309d617d0475b5de1 refs/heads/websocket
244
+
245
+ ✔ 01 deploy@xxx.xx.xxx.xx 3.504s
246
+
247
+ 00:05 deploy:check:directories
248
+
249
+ 01 mkdir -p /home/deploy/staging/shared /home/deploy/staging/releases
250
+
251
+ 01 bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
252
+
253
+ ✔ 01 deploy@xxx.xx.xxx.xx 0.090s
254
+
255
+ 00:05 deploy:check:linked_dirs
256
+
257
+ 01 mkdir -p /home/deploy/staging/shared/bin /home/deploy/staging/shared/log /home/deploy/staging/shared/tmp/backup /home/deploy/…
258
+
259
+ 01 bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
260
+
261
+ ✔ 01 deploy@xxx.xx.xxx.xx 0.090s
262
+
263
+ 00:05 deploy:check:make_linked_dirs
264
+
265
+ 01 mkdir -p /home/deploy/staging/shared/config
266
+
267
+ 01 bash: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
268
+
269
+ ✔ 01 deploy@xxx.xx.xxx.xx 0.087s
270
+
271
+ 00:05 deploy:check:linked_files
272
+
273
+ linked file /home/deploy/staging/shared/config/secrets.yml does not exist on xxx.xx.xxx.xx
274
+
275
+ ```
124
276
 
125
277
  ###補足情報(言語/FW/ツール等のバージョンなど)
126
278