Add automated help and organize makefile targets

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2019-05-08 22:59:59 -04:00
parent e6ccfb4b59
commit f5aaff9ab1
3 changed files with 61 additions and 103 deletions

View File

@@ -103,7 +103,7 @@ ENV LC_ALL C.UTF-8
RUN touch docker/Makefile
RUN make wheel
RUN make python-wheel
RUN chmod 777 dist -R

View File

@@ -3,31 +3,23 @@ IMAGE_VERSION ?= `cat docker/version`
CONSOLE_COLUMNS ?= `echo $$(tput cols)`
CONSOLE_LINES ?= `echo $$(tput lines)`
docker-help:
@echo
@echo "**** Docker makefile ****"
@echo "docker-build - Build a new image locally."
@echo "docker-build-with-proxy - Build a new image locally using an APT proxy."
@echo "docker-test-container - Build and run a test container."
@echo "docker-test-cleanup - Delete the test container and the test volume."
@echo "docker-test-all - Build and executed the test suite in a test container."
@echo "docker-shell - Launch a bash instance inside a running container. Pass the container name via DOCKER_CONTAINER."
docker-build:
docker-build: ## Build a new image locally.
docker build -t mayanedms/mayanedms:$(IMAGE_VERSION) -f docker/Dockerfile .
docker-build-with-proxy:
docker-build-with-proxy: ## Build a new image locally using an APT proxy.
docker build -t mayanedms/mayanedms:$(IMAGE_VERSION) -f docker/Dockerfile --build-arg APT_PROXY=$(APT_PROXY) .
docker-shell:
docker-shell: ## Launch a bash instance inside a running container. Pass the container name via DOCKER_CONTAINER.
docker exec -e TERM=$(TERM) -e "COLUMNS=$(CONSOLE_COLUMNS)" -e "LINES=$(CONSOLE_LINES)" -it $(DOCKER_CONTAINER) /bin/bash
docker-test-container: ## Build and run a test container.
docker-test-container: docker-build-with-proxy docker-test-cleanup
docker run -d --name test-mayan-edms -p 80:8000 -v test-mayan_data:/var/lib/mayan mayanedms/mayanedms:$(DOCKER_VERSION)
docker-test-cleanup:
docker-test-cleanup: ## Delete the test container and the test volume.
@docker rm -f test-mayan-edms || true
@docker volume rm test-mayan_data || true
docker-test-all: ## Build and executed the test suite in a test container.
docker-test-all: docker-build-with-proxy
docker run --rm run-tests