-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (67 loc) · 2.15 KB
/
Copy pathMakefile
File metadata and controls
80 lines (67 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Makefile for BleachBit documentation site
.PHONY: help clean serve build install update \
docker-serve docker-build docker-shell docker-down
# Default target
help:
@echo "Available targets:"
@echo " help - Show this help message"
@echo " clean - Remove generated files and dependencies"
@echo " serve - Start local development server"
@echo " build - Build the static site"
@echo " install - Install Ruby dependencies"
@echo " update - Update Ruby dependencies"
@echo ""
@echo " docker-serve - Start the development server in a container"
@echo " docker-build - Build the static site in a container"
@echo " docker-shell - Open a shell in the container"
@echo " docker-down - Stop the container"
# Clean generated files and dependencies
clean:
@echo "Cleaning generated files..."
git clean -dfx
@echo "Collecting garbage in git..."
git gc
@echo "Clean complete."
# Install Ruby dependencies
install:
@echo "Installing Ruby dependencies..."
bundle install
@echo "Dependencies installed"
# Update Ruby dependencies
update:
@echo "Updating Ruby dependencies..."
bundle update
@echo "Dependencies updated."
@echo "Listing outdated dependencies..."
bundle outdated
# Build the static site
build:
@echo "Building site..."
bundle exec jekyll build
@echo "Site built in _site/"
# Serve locally for development
serve:
@echo "Starting development server..."
bundle exec jekyll serve --drafts
# Serve locally without drafts (production-like)
serve-prod:
@echo "Starting production-like server..."
bundle exec jekyll serve
# Compose reads .env automatically, so the container runs as the host user
# instead of root. Delete this file if your uid changes.
.env:
@printf 'HOST_UID=%s\nHOST_GID=%s\n' $$(id -u) $$(id -g) > $@
@echo "Wrote $@"
# Serve in a container
docker-serve: .env
docker compose up --build
# Build the static site in a container
docker-build: .env
docker compose run --rm --build docs jekyll build
@echo "Site built in _site/"
# Shell in the container, for bundle update and friends
docker-shell: .env
docker compose run --rm --build --entrypoint bash docs
# Stop the container
docker-down:
docker compose down