Skip to content

Commit 0bd7b07

Browse files
committed
Add node-prune.
1 parent 6bd2ea4 commit 0bd7b07

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.circleci/config.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ references:
1919
orbs:
2020
aws-cli: circleci/aws-cli@2.0.3
2121
slack: circleci/slack@3.3.0
22+
go: circleci/go@1.7.0
2223

2324
executors:
2425
default:
@@ -27,6 +28,11 @@ executors:
2728
- image: circleci/node:12.13.0-browsers
2829

2930
commands:
31+
prepare-go:
32+
description: 'go 言語をインストール'
33+
steps:
34+
- go/install
35+
3036
prepare-aws-cli:
3137
description: 'AWS CLIを準備'
3238
steps:
@@ -56,6 +62,7 @@ commands:
5662
steps:
5763
- prepare-resources
5864
- prepare-aws-cli
65+
- prepare-go
5966

6067
jobs:
6168
lint-and-test:
@@ -114,6 +121,7 @@ jobs:
114121
command: |
115122
if [ $ALIS_APP_ID ]; then
116123
sudo npm install -g 'serverless@1.x'
124+
sudo go get github.com/tj/node-prune@1.2.0
117125
yarn deploy
118126
fi
119127
@@ -129,7 +137,8 @@ jobs:
129137
name: 'Deployment'
130138
command: |
131139
if [ $ALIS_APP_ID ] && [ $CIRCLE_PROJECT_USERNAME != 'AlisProject' ]; then
132-
sudo npm install -g 'serverless@<2.0.0'
140+
sudo npm install -g 'serverless@1.x'
141+
sudo go get github.com/tj/node-prune@1.2.0
133142
yarn deploy
134143
fi
135144

deploy.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,8 @@ aws s3 cp app/static/header_logo_original.png s3://${DIST_S3_BUCKET_NAME}/d/nuxt
1818
# yarn.lockの内容で、本番で使用するパッケージだけをインストール
1919
yarn install --production --frozen-lockfile
2020

21+
# node-module の不要ファイルを削除
22+
node-prune ./node_modules
23+
24+
# デプロイ
2125
yarn sls:deploy

0 commit comments

Comments
 (0)