Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Refactor backend fix #101

Merged
merged 14 commits into from
Mar 14, 2020
5 changes: 3 additions & 2 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
./functions/node_modules
./docker-mount
functions/node_modules
docker-mount
functions/lib
18 changes: 11 additions & 7 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ Pj-marowd Cloud Functions
1. ` cd backend/functions `
1. ` yarn run lint `

# Dockerを使ったローカル動作確認手順
## (一回で良い)ci用トークンの取得
- `docker build -t runner . && docker run runner /bin/sh` でコンテナを作ってその中に入る
- コンテナ内で`firebase login:ci --no-localhost` でログインするとtokenが取得できるのでメモる。

# Use with docker
ci用のtokenを使ってデプロイします。
1. `$ firebase login:ci --no-localhost` でtokenを取得
あとはこれ
`$ docker run --env TOKEN=<token> --name runner-container -p 9005:9005 pj-marowd-backend /bin/sh`

移動して`$ firebase deploy --token $TOKEN`
## ローカルにCloud Functionsを立てて動作確認(localhost:5000)
- 先ほど作成したci用トークンを取得して`docker build -t runner . && docker run --env TOKEN=<token> runner /bin/sh`
- `cd functions`
- `npm run serve`で動作します。

## デプロイ
- 先ほど作成したci用トークンを取得して`docker build -t runner . && docker run --env TOKEN=<token> runner /bin/sh`
- `firebase deploy --token $TOKEN`で動作します。
2 changes: 2 additions & 0 deletions backend/functions/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@
"project": "./tsconfig.json"
},
"rules": {
// for @kanade9 DBに渡るときスネークケースなので強制キャメルケース制約をOFFにしました。
"@typescript-eslint/camelcase": ["error", { "properties": "never" } ]
}
}
Loading