Skip to content

Commit fe928b2

Browse files
committed
Add lms-restart and studio-restart make targets
Kills the running Django development server and lets the watcher process restart it. Thanks @doctoryes for the original kill command.
1 parent 92f6a07 commit fe928b2

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ lms-watcher-shell: ## Run a shell on the LMS watcher container
138138
lms-attach: ## Attach to the LMS container process to use the debugger & see logs.
139139
docker attach edx.devstack.lms
140140

141+
lms-restart: ## Kill the LMS Django development server. The watcher process will restart it.
142+
docker exec -t edx.devstack.lms bash -c 'kill $$(ps aux | grep "manage.py lms" | egrep -v "while|grep" | awk "{print \$$2}")'
143+
141144
studio-shell: ## Run a shell on the Studio container
142145
docker exec -it edx.devstack.studio env TERM=$(TERM) /edx/app/edxapp/devstack.sh open
143146

@@ -147,6 +150,9 @@ studio-watcher-shell: ## Run a shell on the studio watcher container
147150
studio-attach: ## Attach to the Studio container process to use the debugger & see logs.
148151
docker attach edx.devstack.studio
149152

153+
studio-restart: ## Kill the LMS Django development server. The watcher process will restart it.
154+
docker exec -t edx.devstack.studio bash -c 'kill $$(ps aux | grep "manage.py cms" | egrep -v "while|grep" | awk "{print \$$2}")'
155+
150156
%-static: ## Rebuild static assets for the specified service container
151157
docker exec -t edx.devstack.$* bash -c 'source /edx/app/$*/$*_env && cd /edx/app/$*/$*/ && make static'
152158

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ CMS:
467467
468468
kill -9 $(ps aux | grep 'manage.py cms' | egrep -v 'while|grep' | awk '{print $2}')
469469
470+
From your host machine, you can also run ``make lms-restart`` or
471+
``make studio-restart`` which run those commands in the containers for you.
472+
470473
PyCharm Integration
471474
-------------------
472475

0 commit comments

Comments
 (0)