7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-26 16:53:28 +00:00
tutor/Makefile
Régis Behmo 1f7e68c662 Working devstack
This allows the user to run their own devstack inside the containers.
Yay!

Also, we handle file permissions cleanly: in docker-entrypoint.sh we
chmod the data and edx-platform files to the same UID of the user on the
host machine. No more permission headaches!
2018-04-12 11:36:14 +02:00

65 lines
1.8 KiB
Makefile

.PHONY: all configure build migrate assets up daemon
DOCKER_COMPOSE_RUN = docker-compose run --rm -e USERID="$$(id -u)"
ifneq ($(EDX_PLATFORM_SETTINGS),)
DOCKER_COMPOSE_RUN += -e SETTINGS=$(EDX_PLATFORM_SETTINGS)
endif
ifneq ($(EDX_PLATFORM_PATH),)
DOCKER_COMPOSE_RUN += --volume="$(EDX_PLATFORM_PATH):/openedx/edx-platform"
endif
DOCKER_COMPOSE_RUN_LMS = $(DOCKER_COMPOSE_RUN) -p 8000:8000 lms
DOCKER_COMPOSE_RUN_CMS = $(DOCKER_COMPOSE_RUN) -p 8001:8001 cms
all: configure build migrate assets daemon
##################### Bootstrapping
configure:
./configure
build:
docker-compose build
migrate:
$(DOCKER_COMPOSE_RUN_LMS) bash -c "wait-for-greenlight.sh && ./manage.py lms migrate"
$(DOCKER_COMPOSE_RUN_CMS) bash -c "wait-for-greenlight.sh && ./manage.py cms migrate"
assets:
$(DOCKER_COMPOSE_RUN_LMS) paver update_assets lms
$(DOCKER_COMPOSE_RUN_CMS) paver update_assets cms
##################### Running
up:
docker-compose up
daemon:
docker-compose up -d && \
echo "Daemon is up and running"
stop:
docker-compose stop
##################### Extra
import-demo-course:
$(DOCKER_COMPOSE_RUN_CMS) /bin/bash -c "git clone https://github.com/edx/edx-demo-course ../edx-demo-course && git -C ../edx-demo-course checkout open-release/ginkgo.master && python ./manage.py cms import ../data ../edx-demo-course"
# Seed the course permissions: is it necessary? "./manage.py lms seed_permissions_roles 'course-v1:edX+DemoX+Demo_Course'"
create-staff-user:
$(DOCKER_COMPOSE_RUN_LMS) /bin/bash -c "./manage.py lms manage_user --superuser --staff ${USERNAME} ${EMAIL} && ./manage.py lms changepassword ${USERNAME}"
##################### Development
lms:
$(DOCKER_COMPOSE_RUN_LMS) bash
cms:
$(DOCKER_COMPOSE_RUN_CMS) bash
lms-shell:
$(DOCKER_COMPOSE_RUN_LMS) ./manage.py lms shell
cms-shell:
$(DOCKER_COMPOSE_RUN_LMS) ./manage.py cms shell