feat(feat(init): serviceOfMachines):

This commit is contained in:
2024-03-26 16:03:24 +03:00
parent 6eb9973b61
commit f6ca446f92
22 changed files with 4644 additions and 458 deletions

View File

@@ -1,12 +1,19 @@
HOOK_NAME=pre-push
HOOK_PATH=.git/hooks/$(HOOK_NAME)
HOOK_PATH=../.git/hooks/$(HOOK_NAME)
pre_hook:
prehook:
@echo "Setting up pre-push hook..."
@rm -f $(HOOK_PATH)
@echo '#!/bin/sh' >> $(HOOK_PATH)
@echo 'echo "Running tests..."' >> $(HOOK_PATH)
@echo 'go test ./...' >> $(HOOK_PATH)
@echo 'echo "Running lint for proxy-ui-app"' >> $(HOOK_PATH)
@echo 'cd ./proxy-ui-app' >> $(HOOK_PATH)
@echo 'yarn lint' >> $(HOOK_PATH)
@echo 'if [ $$? -ne 0 ]; then' >> $(HOOK_PATH)
@echo ' echo "Tests failed, push aborted."' >> $(HOOK_PATH)
@echo ' exit 1' >> $(HOOK_PATH)
@echo 'fi' >> $(HOOK_PATH)
@echo 'echo "Running tests for proxy-ui"' >> $(HOOK_PATH)
@echo 'yarn test_ones' >> $(HOOK_PATH)
@echo 'if [ $$? -ne 0 ]; then' >> $(HOOK_PATH)
@echo ' echo "Tests failed, push aborted."' >> $(HOOK_PATH)
@echo ' exit 1' >> $(HOOK_PATH)
@@ -14,3 +21,10 @@ pre_hook:
@echo 'exit 0' >> $(HOOK_PATH)
@chmod +x $(HOOK_PATH)
@echo "Pre-push hook set successfully."
push:
ifeq ($(commit),)
$(error mn is not set)
endif
make prehook
git add . && git commit -m "feat($(commit)):" && git push