Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit b8216f5

Browse files
committed
fix: don't allocate a tty for non-shell docker exec commands
Several commands in the Makefile use `docker-compose exec` to execute commands in service containers. This is all well and good, but those commands will fail in non-TTY situations like GitHub Actions if the -T flag is not provided. We do not make this change for `dev.shell` and `dev.dbshell` commands, because a TTY is needed there in order to provide a smooth interactive shell experience.
1 parent a2ceda6 commit b8216f5

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,14 +390,14 @@ dev.cache-programs: ## Copy programs from Discovery to Memcached for use in LMS.
390390
dev.restart-devserver: _expects-service.dev.restart-devserver
391391

392392
dev.restart-devserver.forum:
393-
docker-compose exec forum bash -c 'kill $$(ps aux | grep "ruby app.rb" | egrep -v "while|grep" | awk "{print \$$2}")'
393+
docker-compose exec -T forum bash -c 'kill $$(ps aux | grep "ruby app.rb" | egrep -v "while|grep" | awk "{print \$$2}")'
394394

395395
dev.forum.build-indices: ## Build indices for forum service
396-
docker-compose exec forum bash -c "cd forum && source ruby_env && source devstack_forum_env && cd cs_comments_service/ && bin/rake search:rebuild_indices"
396+
docker-compose exec -T forum bash -c "cd forum && source ruby_env && source devstack_forum_env && cd cs_comments_service/ && bin/rake search:rebuild_indices"
397397

398398
dev.restart-devserver.%: ## Kill an edX service's development server. Watcher should restart it.
399399
# Applicable to Django services only.
400-
docker-compose exec $* bash -c 'kill $$(ps aux | egrep "manage.py ?\w* runserver" | egrep -v "while|grep" | awk "{print \$$2}")'
400+
docker-compose exec -T $* bash -c 'kill $$(ps aux | egrep "manage.py ?\w* runserver" | egrep -v "while|grep" | awk "{print \$$2}")'
401401

402402
dev.logs: ## View logs from running containers.
403403
docker-compose logs -f
@@ -468,13 +468,13 @@ $(foreach asset_service,$(ASSET_SERVICES_LIST),\
468468
dev.static: | $(_asset_compilation_targets)
469469

470470
dev.static.lms:
471-
docker-compose exec lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && paver update_assets lms'
471+
docker-compose exec -T lms bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && paver update_assets lms'
472472

473473
dev.static.studio:
474-
docker-compose exec studio bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && paver update_assets studio'
474+
docker-compose exec -T studio bash -c 'source /edx/app/edxapp/edxapp_env && cd /edx/app/edxapp/edx-platform/ && paver update_assets studio'
475475

476476
dev.static.%: ## Rebuild static assets for the specified service's container.
477-
docker-compose exec $* bash -c 'source /edx/app/$*/$*_env && cd /edx/app/$*/$*/ && make static'
477+
docker-compose exec -T $* bash -c 'source /edx/app/$*/$*_env && cd /edx/app/$*/$*/ && make static'
478478

479479

480480
########################################################################################

0 commit comments

Comments
 (0)