質問編集履歴
3
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,8 +16,6 @@
|
|
16
16
|
ploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:183:in `execute_script'
|
17
17
|
```
|
18
18
|
|
19
|
-
サーバーに直接入って`applicationstart.sh`を実行した場合には、正常に動作します。
|
20
|
-
|
21
19
|
### 該当のソースコード
|
22
20
|
- buildspec.yml
|
23
21
|
```
|
@@ -49,8 +47,6 @@
|
|
49
47
|
npm run start
|
50
48
|
```
|
51
49
|
|
52
|
-
### 原因の
|
50
|
+
### 原因と思われるもの
|
53
|
-
-
|
51
|
+
- デプロイ終了後、本番環境に`/hogehuga/node_modules`が存在していないため`failed with exit code 127`が発生している。
|
54
|
-
|
52
|
+
つまり、`npm install`が実行されていない。
|
55
|
-
- 下記より、CodeDeploy時に実際に実行されるのは`/hogefuga/scripts/applicationstart.sh`ではなく、`/opt/codedeploy-agent/deployment-root/{DeployGroupID}/`に展開されたものなので、それによるキャッシュか何かが影響している?
|
56
|
-
https://dev.classmethod.jp/articles/best-practice-of-code-deploy-hooks/
|
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -42,7 +42,7 @@
|
|
42
42
|
ApplicationStart:
|
43
43
|
- location: scripts/applicationstart.sh
|
44
44
|
```
|
45
|
-
-
|
45
|
+
- applicationstart.sh
|
46
46
|
```
|
47
47
|
#!/bin/bash
|
48
48
|
cd /hogefuga
|
1
追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -16,6 +16,8 @@
|
|
16
16
|
ploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:183:in `execute_script'
|
17
17
|
```
|
18
18
|
|
19
|
+
サーバーに直接入って`applicationstart.sh`を実行した場合には、正常に動作します。
|
20
|
+
|
19
21
|
### 該当のソースコード
|
20
22
|
- buildspec.yml
|
21
23
|
```
|
@@ -48,5 +50,7 @@
|
|
48
50
|
```
|
49
51
|
|
50
52
|
### 原因の仮説
|
51
|
-
- 下記
|
53
|
+
- 下記より、`failed with exit code 127`の原因は`npm install`をしていないかららしいので、`npm run start`を行うタイミングが間違っている?
|
52
|
-
https://github.com/reactstrap/reactstrap/issues/711
|
54
|
+
https://github.com/reactstrap/reactstrap/issues/711
|
55
|
+
- 下記より、CodeDeploy時に実際に実行されるのは`/hogefuga/scripts/applicationstart.sh`ではなく、`/opt/codedeploy-agent/deployment-root/{DeployGroupID}/`に展開されたものなので、それによるキャッシュか何かが影響している?
|
56
|
+
https://dev.classmethod.jp/articles/best-practice-of-code-deploy-hooks/
|