feat: add COMPOSE_MOUNTS for xqueue

A `COMPOSE_MOUNTS` function has been added to easily mount
`xqueue` to `/openedx/xqueue`
This commit is contained in:
Carlos Muniz 2022-07-20 16:08:45 -04:00
parent 63fd458c8d
commit 4ac2ae8d59

View File

@ -57,6 +57,20 @@ tutor_hooks.Filters.IMAGES_PUSH.add_item((
"{{ XQUEUE_DOCKER_IMAGE }}", "{{ XQUEUE_DOCKER_IMAGE }}",
)) ))
@tutor_hooks.Filters.COMPOSE_MOUNTS.add()
def _mount_xqueue(volumes, name):
"""
When mounting xqueue with `--mount=/path/to/xqueue`,
bind-mount the host repo in the xqueue container.
"""
if name == "xqueue":
path = "/openedx/xqueue"
volumes += [
("xqueue", path),
("xqueue-job", path),
]
return volumes
@click.group(help="Interact with the Xqueue server", name="xqueue") @click.group(help="Interact with the Xqueue server", name="xqueue")
def command(): def command():
pass pass