From 36cacf471744978f79e7c53e37b49b8cc4fb14a3 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Fri, 2 Aug 2024 01:26:04 +0330 Subject: [PATCH] feat: new make commands to interact with dev container * dev.stop: Stop the running container * dev.migrate: Run migrations in the container * dev.logs: View logs from the container * dev.exec: Execute to the dev container --- .../{{cookiecutter.repo_name}}/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cookiecutter-xblock/{{cookiecutter.repo_name}}/Makefile b/cookiecutter-xblock/{{cookiecutter.repo_name}}/Makefile index 1fdbc3cc..20802d1d 100644 --- a/cookiecutter-xblock/{{cookiecutter.repo_name}}/Makefile +++ b/cookiecutter-xblock/{{cookiecutter.repo_name}}/Makefile @@ -51,6 +51,18 @@ dev.build: dev.run: dev.clean dev.build ## Clean, build and run test image docker run -p 8000:8000 -v $(CURDIR):/usr/local/src/$(REPO_NAME) --name $(REPO_NAME)-dev $(REPO_NAME)-dev +dev.stop: ## Stop the running container + docker stop $(REPO_NAME)-dev + +dev.migrate: ## Run migrations in the container + docker exec -it $(REPO_NAME)-dev python manage.py migrate + +dev.logs: ## View logs from the container + docker logs -f $(REPO_NAME)-dev + +dev.exec: ## Execute to the dev container + docker exec -it $(REPO_NAME)-dev /bin/bash + ## Localization targets extract_translations: ## extract strings to be translated, outputting .po files