makefile update 2
All checks were successful
Build Org Website / build (push) Successful in 48s

This commit is contained in:
2026-05-07 14:34:39 +01:00
parent dc244c1e98
commit 3c1f76e65c
3 changed files with 52 additions and 17 deletions

View File

@@ -1,11 +1,15 @@
.PHONY: all clean norm author help .PHONY: all clean norm author author-stop author-restart help
VENV := .venv VENV := .venv
PY := $(VENV)/bin/python PY := $(VENV)/bin/python
PIP := $(VENV)/bin/pip PIP := $(VENV)/bin/pip
PERM_DIR := /home/zaine/master-folder/projects/scripts/bash-scripts PERM_DIR := /home/zaine/master-folder/projects/scripts/bash-scripts
all: set-perms clean-output build search clean-venv author AUTHOR_PORT := 8765
AUTHOR_PID := /home/zaine/logs/authoring-server.pid
AUTHOR_LOG := /home/zaine/logs/authoring-server.log
all: set-perms clean-output build search clean-venv author-restart
build: build:
@echo "Building project..." @echo "Building project..."
@@ -37,18 +41,49 @@ norm:
find . -path ./backups -prune -o -type f -name '*~' -exec mv {} backups/ \; find . -path ./backups -prune -o -type f -name '*~' -exec mv {} backups/ \;
author: author:
@echo "Starting local authoring UI..." @echo "Starting local authoring UI in foreground..."
python3 authoring_server.py python3 authoring_server.py
# Show help message author-stop:
@echo "Stopping existing authoring UI if running..."
@mkdir -p /home/zaine/logs
@if [ -f "$(AUTHOR_PID)" ]; then \
PID=$$(cat "$(AUTHOR_PID)"); \
if kill -0 $$PID 2>/dev/null; then \
echo "Killing PID $$PID"; \
kill $$PID || true; \
sleep 1; \
fi; \
rm -f "$(AUTHOR_PID)"; \
fi
@fuser -k $(AUTHOR_PORT)/tcp 2>/dev/null || true
author-restart: author-stop
@echo "Starting authoring UI on port $(AUTHOR_PORT)..."
@mkdir -p /home/zaine/logs
@nohup python3 authoring_server.py > "$(AUTHOR_LOG)" 2>&1 & echo $$! > "$(AUTHOR_PID)"
@echo "Waiting for authoring UI to respond..."
@for i in 1 2 3 4 5 6 7 8 9 10; do \
if curl -fsS http://127.0.0.1:$(AUTHOR_PORT)/ >/dev/null; then \
echo "Authoring UI is running on http://127.0.0.1:$(AUTHOR_PORT)/"; \
exit 0; \
fi; \
sleep 1; \
done; \
echo "Authoring UI failed to start. Last logs:"; \
tail -n 40 "$(AUTHOR_LOG)" || true; \
exit 1
help: help:
@echo "Available targets:" @echo "Available targets:"
@echo " make - Full rebuild" @echo " make - Full rebuild and restart authoring UI"
@echo " make build - Rebuild the output directory" @echo " make build - Rebuild the output directory"
@echo " make set-perms - Set permissions for output directory" @echo " make set-perms - Set permissions for output directory"
@echo " make clean-output - Remove output directory" @echo " make clean-output - Remove output directory"
@echo " make clean-venv - Remove venv directory" @echo " make clean-venv - Remove venv directory"
@echo " make norm - Move all files that end with ~ to the backup folder" @echo " make norm - Move backup files"
@echo " make author - Start the local authoring UI" @echo " make author - Start the local authoring UI in foreground"
@echo " make search - creates the search index" @echo " make author-stop - Stop the authoring UI"
@echo " make help - Show this help message!" @echo " make author-restart - Restart the authoring UI in background"
@echo " make search - Create the search index"
@echo " make help - Show this help message"

View File

@@ -4,7 +4,7 @@
See the categories: @@html:<a href="../home/categories.html">Categories</a>@@ See the categories: @@html:<a href="../home/categories.html">Categories</a>@@
* Posts: * Posts:
- [[file:career/career-list.org][Career List]] @@html:<span class="post-date">07-05-2026 14:21</span>@@ - [[file:career/career-list.org][Career List]] @@html:<span class="post-date">07-05-2026 14:34</span>@@
- [[file:posts-list.sync-conflict-20260417-233432-VT6366A.org][Posts List]] @@html:<span class="post-date">14-04-2026 16:36</span>@@ - [[file:posts-list.sync-conflict-20260417-233432-VT6366A.org][Posts List]] @@html:<span class="post-date">14-04-2026 16:36</span>@@
- [[file:career/ha-dr.org][High Availability, Disaster Recovery and Business Continuity]] @@html:<span class="post-date">11-03-2026 17:18</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@ - [[file:career/ha-dr.org][High Availability, Disaster Recovery and Business Continuity]] @@html:<span class="post-date">11-03-2026 17:18</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@
- [[file:career/javascript.org][Understands the Javascript language]] @@html:<span class="post-date">11-03-2026 16:52</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@ - [[file:career/javascript.org][Understands the Javascript language]] @@html:<span class="post-date">11-03-2026 16:52</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@

View File

@@ -12,12 +12,12 @@
- [[file:tags/notes.org][Tag: notes]] - [[file:tags/notes.org][Tag: notes]]
- [[file:tags/review.org][Tag: review]] - [[file:tags/review.org][Tag: review]]
- [[file:tags/website.org][Tag: website]] - [[file:tags/website.org][Tag: website]]
- [[file:tags/life.org][Tag: life]]
- [[file:tags/update.org][Tag: update]] - [[file:tags/update.org][Tag: update]]
- [[file:tags/insights.org][Tag: insights]] - [[file:tags/life.org][Tag: life]]
- [[file:tags/emacs.org][Tag: emacs]]
- [[file:tags/education.org][Tag: education]] - [[file:tags/education.org][Tag: education]]
- [[file:tags/insights.org][Tag: insights]]
- [[file:tags/reading.org][Tag: reading]] - [[file:tags/reading.org][Tag: reading]]
- [[file:tags/emacs.org][Tag: emacs]]
- [[file:tags/maths.org][Tag: maths]] - [[file:tags/maths.org][Tag: maths]]
- home - home
- [[file:home/countdown.org][Countdown]] - [[file:home/countdown.org][Countdown]]