-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (40 loc) · 1.39 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Docker
COMPOSE = docker-compose
COMPOSE_RUN = $(COMPOSE) run --rm
COMPOSE_EXEC = $(COMPOSE) exec
# Django
MANAGE = $(COMPOSE_EXEC) lms dockerize -wait tcp://mysql:3306 -timeout 60s python manage.py
default: help
bootstrap: build dev migrate index superuser demo ## bootstrap the project
.PHONY: bootstrap
build: ## build the forum image
$(COMPOSE) build forum lms
.PHONY: build
demo: ## import demo course
$(MANAGE) cms import /edx/app/edxapp/data /edx/demo/course
.PHONY: demo
dev: ## start the forum service (and its dependencies)
$(COMPOSE) up -d forum
.PHONY: dev
down: ## stop & remove all services
$(COMPOSE) down
.PHONY: stop
index: ## initialize elasticsearch index
$(COMPOSE_EXEC) forum bin/rake search:initialize
.PHONY: index
migrate: ## perform database migrations
$(MANAGE) lms migrate
$(MANAGE) cms migrate
.PHONY: migrate
status: ## an alias for docker-compose ps
$(COMPOSE) ps
.PHONY: status
stop: ## stop running services
$(COMPOSE) stop
.PHONY: stop
superuser: ## create superuser (Open edX LMS)
$(MANAGE) lms shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@foex.edu', 'openedx-rox')";
.PHONY: superuse
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help