This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
103 lines (95 loc) · 2.44 KB
/
serverless.yml
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
# Service name
service: bp-cron
# Provider
provider:
name: aws
runtime: python3.7
region: ap-northeast-1
logRetentionInDays: 14
environment:
TZ: Asia/Tokyo
SLACK_API_TOKEN: ${env:SLACK_API_TOKEN}
GITHUB_API_TOKEN: ${env:GITHUB_API_TOKEN}
GITHUB_ORGANIZATION: ${env:GITHUB_ORGANIZATION}
GITHUB_SPREADSHEET_URL: ${env:GITHUB_SPREADSHEET_URL}
CIRCLECI: ${env:CIRCLECI, "false"}
deploymentBucket:
name: bp-cron-serverless-deployment
# Package
package:
individually: true
include:
- src/**
exclude:
- env/**
- .git/
- .gitignore
- .env
- node_modules/**
- env.sample
- README.md
- package.json
- package-lock.json
- Makefile
- LICENSE
- ChangeLog.txt
- requirements.txt
- black/pyproject.toml
- tox.ini
- test/**
- doc/**
# Lambda functions
functions:
# 誕生日通知
# https://tracery.jp/s/f4c338a716074e17bbb242a696de006c
birthday:
handler: src/handlers/birthday.job
timeout: 30
layers:
- {Ref: PythonRequirementsLambdaLayer}
events:
- schedule: cron(30 00 * * ? *)
# 9:00 くらいにカレンダーからミーティング一覧通知
# https://tracery.jp/s/08a63d6bcaba4e7388af40de3dc4453c
meeting_reminder:
handler: src/handlers/meeting_reminder.job
timeout: 30
layers:
- {Ref: PythonRequirementsLambdaLayer}
events:
- schedule: cron(0 00 * * ? *)
# 直近開催のミーティングを通知
# https://tracery.jp/s/f34f8f8f368b4c3c9ef5726375e08c22
meeting_reminder_recent:
handler: src/handlers/meeting_reminder.recent
timeout: 30
layers:
- {Ref: PythonRequirementsLambdaLayer}
events:
- schedule: cron(0/15 0-9 * * ? *)
# 月1(10日)にGitHubのメンバー一覧を通知する
# https://tracery.jp/s/c22b55c5a944482bb40831a3aa2c52b2
github_notification:
handler: src/handlers/github_reminder.notify_member_check
timeout: 30
layers:
- {Ref: PythonRequirementsLambdaLayer}
events:
- schedule: cron(0 00 10 * ? *)
# Plugins
plugins:
- serverless-python-requirements
- serverless-prune-plugin
# Custom settings
custom:
pythonRequirements:
# ref: https://qiita.com/sot528/items/6bdf6857ae1076f2a7a2
dockerizePip: ${self:custom.isDockerizePip.${env:CIRCLECI}, self:custom.isDockerizePip.false}
slim: true
layer: true
isDockerizePip:
true: false
false: true
prune:
automatic: true
number: 3