-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsettings.py
64 lines (48 loc) · 1.75 KB
/
settings.py
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
import os
from enum import unique, Enum
#TODO move these to a settings.yml so they can be re-used in the serverless yml
# using https://serverless.com/framework/docs/providers/aws/guide/variables/#reference-variables-in-other-files
STAGE = os.environ['stage']
class Person:
def __init__(self, email, phone):
self.email = email
self.phone = phone
@unique
class People(Enum):
"""
<configure-me>
ex.- john_smith = Person('[email protected]', 1234567890)
"""
# order to mathc datetime.weekday()
MON, TUE, WED, THU, FRI, SAT, SUN = range(7)
# A mapping of People to be set to the user group for each day
# <configure-me>
WEEKDAY_ROTATION = {
# Monday
MON: [], # ex: [People.person1, People.person2],
# Tuesday
TUE: [],
# Wednesday
WED: [],
# Thursday
THU: [],
# Friday
FRI: [],
}
# Rotates the oncall on weekends by pairs in the order of the People enum
ROTATE_WEEKEND_ONCALL = True
# The Slack @user-group to update (Default: oncall)
# If set to "oncall" it would be referenced via "@oncall" in slack
ALIAS_NAME = "oncall"
# timezone you want to use for schedule. This will be used to determine what day it is for the WEEKDAY_ROTATION
TIMEZONE = 'America/Los_Angeles'
# Number of days ahead to schedule calendar events
DAYS_AHEAD = 45
# Google Calendar ID (ex.- '[email protected]'). Set to None to disable.
GOOGLE_CAL_ID = None
# sensitive vars loaded from env vars
try:
SLACK_API_TOKEN = os.environ['SLACK_SMART_ALIAS_SLACK_API_TOKEN']
GOOGLE_SERVICE_ACCOUNT_KEYFILE = os.environ['GOOGLE_SERVICE_ACCOUNT_KEYFILE'] # set to None to disable
except KeyError as e:
raise Exception("Make sure all the required env vars are set! {} was missing".format(e.args[0]))