forked from openedx-unsupported/devstack
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtahoe.mk
56 lines (43 loc) · 2.42 KB
/
tahoe.mk
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
54
55
56
DEVSTACK_WORKSPACE ?= ..
tahoe.exec.single: ## Execute a command inside a devstack docker container
docker exec -t edx.$(COMPOSE_PROJECT_NAME).$(SERVICE) \
bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && $(COMMAND)'
tahoe.exec.edxapp: ## Execute a command in both LMS and Studio (edxapp containers)
make COMMAND='$(COMMAND)' SERVICE=lms tahoe.exec.single
make COMMAND='$(COMMAND)' SERVICE=studio tahoe.exec.single
tahoe.chown: ## Fix annoying docker permission issues
sudo chown -R $(USER) $(DEVSTACK_WORKSPACE)
tahoe.provision: ## Make the devstack more Tahoe'ish
make tahoe.chown
cat $(DEVSTACK_WORKSPACE)/devstack/provision-tahoe.py > $(DEVSTACK_WORKSPACE)/src/provision-tahoe.py
make COMMAND='python /edx/src/provision-tahoe.py' tahoe.exec.edxapp
rm $(DEVSTACK_WORKSPACE)/src/provision-tahoe.py
make tahoe.restart || true
make tahoe.chown
tahoe.up: ## Deprecated: Use `make dev.up` instead.
make dev.up
tahoe.envs._delete: ## Remove settings, in prep for resetting it
sudo rm -rf $(DEVSTACK_WORKSPACE)/src/edxapp-envs
tahoe.restart: ## Restarts both of LMS and Studio python processes while keeping the same container
make lms-restart
make studio-restart
make amc-restart
amc.provision: ## Initializes the AMC
docker exec -it tahoe.$(COMPOSE_PROJECT_NAME).amc python manage.py migrate
make COMMAND='python manage.py lms create_dot_application --grant-type password --redirect-uris=http://localhost:13000 --skip-authorization --client-id=6f2b93d5c02560c3f93f --client-secret=2c6c9ac52dd19d7255dd569fb7eedbe0ebdab2db AMC edx' SERVICE='lms' tahoe.exec.single
docker exec -it tahoe.$(COMPOSE_PROJECT_NAME).amc python manage.py create_devstack_superuser
docker exec -it tahoe.$(COMPOSE_PROJECT_NAME).amc-frontend npm install
amc.activation_links: ## List activation links from the AMC log
docker-compose $(DOCKER_COMPOSE_FILES) logs --tail=1000 amc \
| grep -o 'http:.*accounts/confirm-email/[^/]*/' \
| sed -s 's/tahoe.devstack.amc:19000/localhost:13000/' \
| uniq
amc-shell:
docker exec -it tahoe.$(COMPOSE_PROJECT_NAME).amc bash
amc-frontend-shell:
docker exec -it tahoe.$(COMPOSE_PROJECT_NAME).amc-frontend bash
amc-restart:
docker exec -t tahoe.$(COMPOSE_PROJECT_NAME).amc bash -c 'killall5'
docker exec -t tahoe.$(COMPOSE_PROJECT_NAME).amc-frontend bash -c 'killall5'
amc-update-db:
docker exec -t tahoe.$(COMPOSE_PROJECT_NAME).amc bash -c './manage.py migrate'