add git hooks for commit validation, auto-suggestions, and Docker build/push automation on git push

This commit is contained in:
Egor Pozharov
2026-04-21 12:54:39 +06:00
parent bf62714d0d
commit 60dea22ced
5 changed files with 136 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ REGISTRY = gitea.chedius.ru/chedius
PLATFORM = linux/amd64
# Build and push both services
.PHONY: all build push deploy
.PHONY: all build push deploy install-hooks
all: build push
@@ -30,11 +30,16 @@ update-server:
docker pull $(REGISTRY)/delivery-tracker/frontend:latest
docker-compose up -d --force-recreate backend frontend
# Full workflow: commit, build, push
# Install git hooks for automation
install-hooks:
git config core.hooksPath .githooks
chmod +x .githooks/*
@echo "✅ Git hooks installed from .githooks/"
# Full release: commit, push, and auto-build via hook
release:
@if [ -z "$(MSG)" ]; then echo "Usage: make release MSG='commit message'"; exit 1; fi
git add -A
git commit -m "$(MSG)" || true
git push
$(MAKE) build push
@echo "Released! Watchtower will deploy within 60 seconds."
@echo "✅ Released! Watchtower will deploy within 60 seconds."