Régis Behmo bbc9dfc5d4 🌅
2019-08-21 12:22:46 +02:00

42 lines
1.1 KiB
Python

from glob import glob
import os
import pkg_resources
from .__about__ import __version__
config = {
"add": {
"AUTH_PASSWORD": "{{ 8|random_string }}",
"MYSQL_PASSWORD": "{{ 8|random_string }}",
"SECRET_KEY": "{{ 24|random_string }}",
},
"defaults": {
"VERSION": __version__,
"DOCKER_IMAGE": "overhangio/openedx-xqueue:{{ XQUEUE_VERSION }}",
"AUTH_USERNAME": "lms",
"MYSQL_DATABASE": "xqueue",
"MYSQL_USERNAME": "xqueue",
},
}
templates = pkg_resources.resource_filename("tutorxqueue", "templates")
hooks = {
"init": ["mysql-client", "xqueue"],
"build-image": {"xqueue": "{{ XQUEUE_DOCKER_IMAGE }}"},
"remote-image": {"xqueue": "{{ XQUEUE_DOCKER_IMAGE }}"},
}
def patches():
all_patches = {}
for path in glob(
os.path.join(pkg_resources.resource_filename("tutorxqueue", "patches"), "*")
):
with open(path) as patch_file:
name = os.path.basename(path)
content = patch_file.read()
all_patches[name] = content
return all_patches