Skip to content
Snippets Groups Projects
Commit 08791697 authored by David Trattnig's avatar David Trattnig
Browse files

Chore: Consolidate with engine-core Makefile #112

parent cd190484
Branches
Tags
No related merge requests found
# Track aus der secondary_queue oder der Playlist entfernen
# Das oder die ID(s) der gerade abgespielten requests erhalten
# @return: Die Antwort des Liquidsoap-Servers (als String)
SPELLING_PATHS = $(wildcard *.md) docs src
SPELLING_EXCLUDE_FILE = .codespell-excludes
-include build/base.Makefile
-include build/docker.Makefile
.PHONY: help
help:
@echo "Supported targets:"
@echo "$(APP_NAME) targets:"
@echo " init.app - init application environment"
@echo " init.dev - init development environment"
@echo " lint - verify code style"
@echo " spelling - check spelling of text"
@echo " spell - check spelling of text"
@echo " style - apply automatic formatting"
@echo " test - run the test suite"
@echo
@echo " test - run test suite"
@echo " log - tail log file"
@echo " run - start app"
$(call docker_help)
.PHONY: init.app
init.app:
......@@ -38,9 +42,12 @@ init.dev:
lint:
python3 -m flake8 .
.PHONY: spelling
spelling:
codespell --exclude-file "$(SPELLING_EXCLUDE_FILE)" $(SPELLING_PATHS)
.PHONY: spell
spell: SPELL_PATHS := $(wildcard *.md) docs src tests config contrib
spell: SPELL_PATHS_SKIP := src/client/playerclient.py
spell: SPELL_IGNORE_FILE := .codespellignore
spell:
codespell --ignore-words "$(SPELL_IGNORE_FILE)" --skip "$(SPELL_PATHS_SKIP)" $(SPELL_PATHS)
.PHONY: style
style:
......@@ -49,4 +56,12 @@ style:
.PHONY: test
test:
python3 -m unittest discover tests
\ No newline at end of file
python3 -m unittest discover tests
.PHONY: log
log:
tail -f logs/AuraEngine.log
.PHONY: run
run:
python3 run.py
# Base config for AURA Makefiles
# Include this at the top of other Makesfiles
.DEFAULT_GOAL := help
APP_NAME := $(shell basename $(dir $(abspath $(dir $$PWD/Makefile))))
\ No newline at end of file
# Docker targets for AURA Makefiles
# Help
define docker_help
@echo " docker.build - build docker image"
@echo " docker.push - push docker image"
@echo " docker.run - start app in container"
@echo " docker.run.i - start app in container (interactive mode)"
@echo " docker.run.bash - start bash in container"
@echo " docker.restart - restart container"
@echo " docker.stop - stop container"
@echo " docker.rm - stop and remove container"
@echo " docker.log - container logs for app"
@echo " docker.bash - enter bash in running container"
endef
# Dependencies
docker.deps:
@which docker
# Targets
.PHONY: docker.build
docker.build: docker.deps
@docker build -t autoradio/$(APP_NAME) .
.PHONY: docker.push
docker/push: docker.deps
@docker push autoradio/$(APP_NAME)
.PHONY: docker.run
docker.run: DOCKER_ENTRY_POINT := -d
docker.run: docker.deps
$(DOCKER_RUN)
.PHONY: docker.run.i
docker.run.i: DOCKER_ENTRY_POINT := -it
docker.run.i: docker.deps
$(DOCKER_RUN)
.PHONY: docker.run.bash
docker.run.bash: DOCKER_ENTRY_POINT := -v "$(CURDIR)":"/srv" --entrypoint bash -it
docker.run.bash: docker.deps
$(DOCKER_RUN)
.PHONY: docker.restart
docker.restart: docker.deps
@docker restart $(APP_NAME)
.PHONY: docker.stop
docker.stop: docker.deps
@docker stop $(APP_NAME)
.PHONY: docker.rm
docker.rm: docker.stop
@docker rm $(APP_NAME)
.PHONY: docker.log
docker.log: docker.deps
@docker logs $(APP_NAME) -f
.PHONY: docker.bash
docker.bash: docker.deps
@docker exec -it $(APP_NAME) bash
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment