bitcoin-services-home/Makefile

40 lines
1.1 KiB
Makefile
Raw Normal View History

2025-12-24 10:39:09 +01:00
SHELL := /bin/bash
.PHONY: build serve deploy help
# Default target
help:
@echo "Available targets:"
@echo " make build - Build the static site"
@echo " make serve - Serve the site locally on port 8000"
@echo " make deploy - Deploy the built site to remote server"
@echo ""
@echo "For deployment, copy deploy.config.example to deploy.config and fill in your details"
# Build the site
build:
@echo "Building site..."
python3 build.py
# Serve locally
serve: build
@echo "Serving site at http://localhost:8000"
@echo "Press Ctrl+C to stop"
cd dist && python3 -m http.server 8000
# Deploy to remote server
deploy: build
@if [ ! -f deploy.config ]; then \
echo "Error: deploy.config not found!"; \
echo "Copy deploy.config.example to deploy.config and fill in your details."; \
exit 1; \
fi
@echo "Deploying to remote server..."
@source deploy.config; \
SSH_CMD="ssh"; \
if [ -n "$$SSH_PORT" ]; then SSH_CMD="$$SSH_CMD -p $$SSH_PORT"; fi; \
if [ -n "$$SSH_KEY" ]; then SSH_CMD="$$SSH_CMD -i $$SSH_KEY"; fi; \
rsync -avz --delete -e "$$SSH_CMD" \
dist/ $$REMOTE_USER@$$REMOTE_HOST:$$REMOTE_PATH
@echo "✓ Deployment complete!"