-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
35 lines (29 loc) · 1.32 KB
/
config.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
import os
from dotenv import load_dotenv
load_dotenv() # Must remain at the top of this file
class Config:
# User configurable settings
allowed_branches = [branch.strip().lower() for branch in os.getenv('ALLOWED_BRANCHES', 'main,master').split(',')]
operation_timeout = int(os.getenv('OPERATION_TIMEOUT', 300)) # Default is 5 minutes
pagination_limit = int(os.getenv('PAGINATION_LIMIT', 20))
deploy_on_tag = os.getenv('DEPLOY_ON_TAG', True) # Whether a tag pushed will trigger a deploy or not
use_slack = bool(os.getenv('USE_SLACK'))
webhook_secret = os.getenv('WEBHOOK_SECRET', '')
slack_bot_token = os.getenv('SLACK_BOT_TOKEN')
slack_channel = os.getenv('SLACK_CHANNEL', 'general')
harvey_path = os.getenv('HARVEY_PATH', os.path.expanduser('~/harvey'))
# Harvey settings
host = os.getenv('HOST', '127.0.0.1')
port = int(os.getenv('PORT', 5000))
harvey_version = '0.23.0'
supported_deployments = {
'deploy',
'pull',
}
default_deployment = 'deploy'
projects_path = os.path.join(harvey_path, 'projects')
database_path = os.path.join(harvey_path, 'databases')
database_file = os.path.join(database_path, 'database.sqlite')
logger_name = 'harvey'
log_level = os.getenv('LOG_LEVEL', 'INFO').upper()
sentry_url = os.getenv('SENTRY_URL')