Makefile 783 B

12345678910111213141516171819202122232425262728293031323334
  1. start:
  2. nohup python3 main.py > /dev/null 2>&1 &
  3. @sleep 1s
  4. @ps -ef | grep main.py | grep -v grep || true
  5. debug:
  6. @python3 main.py
  7. status:
  8. @ps -ef | grep main.py | grep -v grep || true
  9. stop:
  10. @ps -ef | grep main.py | grep -v grep | awk '{print $$2}' | xargs kill || true
  11. @ps -ef | grep main.py | grep -v grep || true
  12. log:
  13. @tail -f log/runtime.log
  14. make test:
  15. @python3 test.py
  16. help:
  17. @echo "Usage: make <target>"
  18. @echo ""
  19. @echo "make start Start server"
  20. @echo "make status Check server status"
  21. @echo "make debug Execute python3 main.py"
  22. @echo "make stop Kill server"
  23. @echo "make test Test local image"
  24. @echo "make log Print log"
  25. @echo "make help Show this help message"
  26. @echo ""
  27. .PHONY: start status debug stop test help log