mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-12 22:27:47 +00:00
07a0323d8e
This gives us the opportunity to develop new hooks: build-image and remote-image.
36 lines
966 B
Python
36 lines
966 B
Python
from glob import glob
|
|
import os
|
|
|
|
HERE = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
config = {
|
|
"add": {
|
|
"AUTH_PASSWORD": "{{ 8|random_string }}",
|
|
"MYSQL_PASSWORD": "{{ 8|random_string }}",
|
|
"SECRET_KEY": "{{ 24|random_string }}",
|
|
},
|
|
"defaults": {
|
|
"DOCKER_IMAGE": "overhangio/openedx-xqueue:{{ TUTOR_VERSION }}",
|
|
"AUTH_USERNAME": "lms",
|
|
"MYSQL_DATABASE": "xqueue",
|
|
"MYSQL_USERNAME": "xqueue",
|
|
},
|
|
}
|
|
|
|
templates = os.path.join(HERE, "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(HERE, "patches", "*")):
|
|
with open(path) as patch_file:
|
|
name = os.path.basename(path)
|
|
content = patch_file.read()
|
|
all_patches[name] = content
|
|
return all_patches
|