19
19
20
20
21
21
# ROOT path of the project. A pathlib.Path object.
22
+ DATA_PATH = config ('DATA_PATH' , default = 'data' )
22
23
ROOT_PATH = Path (__file__ ).resolve ().parents [2 ]
23
- GIT_REPOS_PATH = ROOT_PATH / 'git-repos'
24
+ DATA_PATH = ROOT_PATH / DATA_PATH
24
25
ROOT = str (ROOT_PATH )
25
26
26
27
27
28
def path (* args ):
28
29
return abspath (str (ROOT_PATH .joinpath (* args )))
29
30
30
31
31
- def git_repo_path (* args ):
32
- return abspath (str (GIT_REPOS_PATH .joinpath (* args )))
32
+ def data_path (* args ):
33
+ return abspath (str (DATA_PATH .joinpath (* args )))
33
34
34
35
35
36
# Is this a dev instance?
@@ -41,7 +42,7 @@ def git_repo_path(*args):
41
42
DATABASES = {
42
43
'default' : {
43
44
'ENGINE' : 'django_prometheus.db.backends.sqlite3' ,
44
- 'NAME' : path ('bedrock.db' ),
45
+ 'NAME' : data_path ('bedrock.db' ),
45
46
},
46
47
}
47
48
@@ -112,7 +113,7 @@ def git_repo_path(*args):
112
113
default = 'product_details.storage.PDDatabaseStorage' )
113
114
# path into which to clone the p-d json repo
114
115
PROD_DETAILS_JSON_REPO_PATH = config ('PROD_DETAILS_JSON_REPO_PATH' ,
115
- default = git_repo_path ('product_details_json' ))
116
+ default = data_path ('product_details_json' ))
116
117
PROD_DETAILS_JSON_REPO_URI = config ('PROD_DETAILS_JSON_REPO_URI' ,
117
118
default = 'https://github.com/mozilla-releng/product-details.git' )
118
119
PROD_DETAILS_JSON_REPO_BRANCH = config ('PROD_DETAILS_JSON_REPO_BRANCH' , default = 'production' )
@@ -134,7 +135,7 @@ def git_repo_path(*args):
134
135
'sr' , 'sv-SE' , 'ta' , 'te' , 'th' , 'tl' , 'tr' , 'trs' , 'uk' , 'ur' ,
135
136
'uz' , 'vi' , 'xh' , 'zh-CN' , 'zh-TW' , 'zu' )
136
137
137
- LOCALES_PATH = ROOT_PATH / 'locale'
138
+ LOCALES_PATH = DATA_PATH / 'locale'
138
139
default_locales_repo = 'www.mozilla.org' if DEV else 'bedrock-l10n'
139
140
default_locales_repo = 'https://github.com/mozilla-l10n/{}' .format (default_locales_repo )
140
141
LOCALES_REPO = config ('LOCALES_REPO' , default = default_locales_repo )
@@ -260,13 +261,13 @@ def lazy_langs():
260
261
FLUENT_DEFAULT_PERCENT_REQUIRED = config ('FLUENT_DEFAULT_PERCENT_REQUIRED' , default = '80' , parser = int )
261
262
FLUENT_REPO = config ('FLUENT_REPO' , default = 'mozmeao/www-l10n' )
262
263
FLUENT_REPO_URL = f'https://github.com/{ FLUENT_REPO } '
263
- FLUENT_REPO_PATH = GIT_REPOS_PATH / 'www-l10n'
264
+ FLUENT_REPO_PATH = DATA_PATH / 'www-l10n'
264
265
# will be something like "<github username>:<github token>"
265
266
FLUENT_REPO_AUTH = config ('FLUENT_REPO_AUTH' , default = '' )
266
267
FLUENT_LOCAL_PATH = ROOT_PATH / 'l10n'
267
268
FLUENT_L10N_TEAM_REPO = config ('FLUENT_L10N_TEAM_REPO' , default = 'mozilla-l10n/www-l10n' )
268
269
FLUENT_L10N_TEAM_REPO_URL = f'https://github.com/{ FLUENT_L10N_TEAM_REPO } '
269
- FLUENT_L10N_TEAM_REPO_PATH = GIT_REPOS_PATH / 'l10n-team'
270
+ FLUENT_L10N_TEAM_REPO_PATH = DATA_PATH / 'l10n-team'
270
271
# 10 seconds during dev and 10 min in prod
271
272
FLUENT_CACHE_TIMEOUT = config ('FLUENT_CACHE_TIMEOUT' , default = '10' if DEBUG else '600' , parser = int )
272
273
# order matters. first sting found wins.
@@ -703,7 +704,7 @@ def get_app_name(hostname):
703
704
# Google Analytics
704
705
GA_ACCOUNT_CODE = ''
705
706
706
- EXTERNAL_FILES_PATH = config ('EXTERNAL_FILES_PATH' , default = git_repo_path ('community_data' ))
707
+ EXTERNAL_FILES_PATH = config ('EXTERNAL_FILES_PATH' , default = data_path ('community_data' ))
707
708
EXTERNAL_FILES_BRANCH = config ('EXTERNAL_FILES_BRANCH' , default = 'master' )
708
709
EXTERNAL_FILES_REPO = config ('EXTERNAL_FILES_REPO' , default = 'https://github.com/mozilla/community-data.git' )
709
710
EXTERNAL_FILES = {
@@ -1352,16 +1353,16 @@ def get_app_name(hostname):
1352
1353
else :
1353
1354
content_cards_default_branch = 'prod-processed'
1354
1355
1355
- CONTENT_CARDS_PATH = config ('CONTENT_CARDS_PATH' , default = git_repo_path ('content_cards' ))
1356
+ CONTENT_CARDS_PATH = config ('CONTENT_CARDS_PATH' , default = data_path ('content_cards' ))
1356
1357
CONTENT_CARDS_REPO = config ('CONTENT_CARDS_REPO' , default = 'https://github.com/mozmeao/www-admin.git' )
1357
1358
CONTENT_CARDS_BRANCH = config ('CONTENT_CARDS_BRANCH' , default = content_cards_default_branch )
1358
1359
CONTENT_CARDS_URL = config ('CONTENT_CARDS_URL' , default = STATIC_URL )
1359
1360
1360
- RELEASE_NOTES_PATH = config ('RELEASE_NOTES_PATH' , default = git_repo_path ('release_notes' ))
1361
+ RELEASE_NOTES_PATH = config ('RELEASE_NOTES_PATH' , default = data_path ('release_notes' ))
1361
1362
RELEASE_NOTES_REPO = config ('RELEASE_NOTES_REPO' , default = 'https://github.com/mozilla/release-notes.git' )
1362
1363
RELEASE_NOTES_BRANCH = config ('RELEASE_NOTES_BRANCH' , default = 'master' )
1363
1364
1364
- WWW_CONFIG_PATH = config ('WWW_CONFIG_PATH' , default = git_repo_path ('www_config' ))
1365
+ WWW_CONFIG_PATH = config ('WWW_CONFIG_PATH' , default = data_path ('www_config' ))
1365
1366
WWW_CONFIG_REPO = config ('WWW_CONFIG_REPO' , default = 'https://github.com/mozmeao/www-config.git' )
1366
1367
WWW_CONFIG_BRANCH = config ('WWW_CONFIG_BRANCH' , default = 'master' )
1367
1368
@@ -1372,7 +1373,7 @@ def get_app_name(hostname):
1372
1373
LEGAL_DOCS_CACHE_TIMEOUT = config ('LEGAL_DOCS_CACHE_TIMEOUT' , default = '60' if DEV else '600' , parser = int )
1373
1374
1374
1375
MOFO_SECURITY_ADVISORIES_PATH = config ('MOFO_SECURITY_ADVISORIES_PATH' ,
1375
- default = git_repo_path ('mofo_security_advisories' ))
1376
+ default = data_path ('mofo_security_advisories' ))
1376
1377
MOFO_SECURITY_ADVISORIES_REPO = config ('MOFO_SECURITY_ADVISORIES_REPO' ,
1377
1378
default = 'https://github.com/mozilla/'
1378
1379
'foundation-security-advisories.git' )
0 commit comments