Files
jiggablend/Makefile
Justin Harms 2deb47e5ad Refactor web build process and update documentation
- Removed Node.js build artifacts from .gitignore and adjusted Makefile to reflect changes in web UI build process, now using server-rendered Go templates instead of React.
- Updated README to clarify the new web UI architecture and output formats, emphasizing the removal of the Node.js build step.
- Added a command to set the number of frames per render task in manager configuration, enhancing user control over rendering settings.
- Improved Gitea workflow by removing unnecessary npm install step, streamlining the CI process.
2026-03-12 19:44:40 -05:00

104 lines
3.7 KiB
Makefile

.PHONY: build build-web run run-manager run-runner cleanup cleanup-manager cleanup-runner clean-bin clean-web test help install
# Build the jiggablend binary (includes embedded web UI)
build:
@echo "Building with GoReleaser..."
goreleaser build --clean --snapshot --single-target
@mkdir -p bin
@find dist -name jiggablend -type f -exec cp {} bin/jiggablend.new \;
@mv -f bin/jiggablend.new bin/jiggablend
# Cleanup manager logs
cleanup-manager:
@echo "Cleaning up manager logs..."
@rm -rf logs/manager.log 2>/dev/null || true
@echo "Manager cleanup complete"
# Cleanup runner logs
cleanup-runner:
@echo "Cleaning up runner logs..."
@rm -rf logs/runner*.log 2>/dev/null || true
@echo "Runner cleanup complete"
# Cleanup both manager and runner logs
cleanup: cleanup-manager cleanup-runner
# Run manager and runner in parallel (for testing)
run: cleanup build init-test
@echo "Starting manager and runner in parallel..."
@echo "Press Ctrl+C to stop both..."
@trap 'kill $$MANAGER_PID $$RUNNER_PID 2>/dev/null; exit' INT TERM; \
bin/jiggablend manager -l manager.log & \
MANAGER_PID=$$!; \
sleep 2; \
bin/jiggablend runner -l runner.log --api-key=jk_r0_test_key_123456789012345678901234567890 & \
RUNNER_PID=$$!; \
wait $$MANAGER_PID $$RUNNER_PID
# Run manager server
run-manager: cleanup-manager build init-test
bin/jiggablend manager -l manager.log
# Run runner
run-runner: cleanup-runner build
bin/jiggablend runner -l runner.log --api-key=jk_r0_test_key_123456789012345678901234567890
# Initialize for testing (first run setup)
init-test: build
@echo "Initializing test configuration..."
bin/jiggablend manager config enable localauth
bin/jiggablend manager config set fixed-apikey jk_r0_test_key_123456789012345678901234567890 -f -y
bin/jiggablend manager config add user test@example.com testpassword --admin -f -y
@echo "Test configuration complete!"
@echo "fixed api key: jk_r0_test_key_123456789012345678901234567890"
@echo "test user: test@example.com"
@echo "test password: testpassword"
# Clean bin build artifacts
clean-bin:
rm -rf bin/
# Clean web build artifacts
clean-web:
@echo "No generated web artifacts to clean."
# Run tests
test:
go test ./... -timeout 30s
# Show help
help:
@echo "Jiggablend Build and Run Makefile"
@echo ""
@echo "Build targets:"
@echo " build - Build jiggablend binary with embedded web UI"
@echo " build-web - Validate web UI assets (no build required)"
@echo ""
@echo "Run targets:"
@echo " run - Run manager and runner in parallel (for testing)"
@echo " run-manager - Run manager server"
@echo " run-runner - Run runner with test API key"
@echo " init-test - Initialize test configuration (run once)"
@echo ""
@echo "Cleanup targets:"
@echo " cleanup - Clean all logs"
@echo " cleanup-manager - Clean manager logs"
@echo " cleanup-runner - Clean runner logs"
@echo ""
@echo "Other targets:"
@echo " clean-bin - Clean build artifacts"
@echo " clean-web - Clean generated web artifacts (currently none)"
@echo " test - Run Go tests"
@echo " help - Show this help"
@echo ""
@echo "CLI Usage:"
@echo " jiggablend manager serve - Start the manager server"
@echo " jiggablend runner - Start a runner"
@echo " jiggablend manager config show - Show configuration"
@echo " jiggablend manager config enable localauth"
@echo " jiggablend manager config add user --email=x --password=y"
@echo " jiggablend manager config add apikey --name=mykey"
@echo " jiggablend manager config set fixed-apikey <key>"
@echo " jiggablend manager config list users"
@echo " jiggablend manager config list apikeys"