forked from nebulabroadcast/nebula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
25 lines (20 loc) · 905 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
IMAGE_NAME=nebulabroadcast/nebula-server:dev
VERSION=$(shell cd backend && poetry run python -c 'import nebula' --version)
check:
cd frontend && \
yarn format
cd backend && \
poetry version $(VERSION) && \
poetry run ruff format . && \
poetry run ruff check --fix . && \
poetry run mypy .
build: check
docker build -t $(IMAGE_NAME) .
dist: build
docker push $(IMAGE_NAME)
setup-hooks:
@echo "Setting up Git hooks..."
@mkdir -p .git/hooks
@echo '#!/bin/sh\n\n# Navigate to the repository root directory\ncd "$$(git rev-parse --show-toplevel)"\n\n# Execute the linting command from the Makefile\nmake check\n\n# Check the return code of the make command\nif [ $$? -ne 0 ]; then\n echo "Linting failed. Commit aborted."\n exit 1\nfi\n\n# If everything is fine, allow the commit\nexit 0' > .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
@echo "Git hooks set up successfully."