-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
125 lines (104 loc) · 3.35 KB
/
Copy pathMakefile
File metadata and controls
125 lines (104 loc) · 3.35 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Termote Makefile
# Usage: make <target>
.PHONY: help build test test-cli test-get test-entrypoints install-container install-native clean release release-dry fmt fmt-check
# Default target
help:
@echo "Termote - Terminal Remote Control"
@echo ""
@echo "Build:"
@echo " make build Build PWA and tmux-api"
@echo " make build-pwa Build PWA only"
@echo " make build-api Build tmux-api only"
@echo ""
@echo "Install:"
@echo " make install-container Install container mode (docker/podman)"
@echo " make install-native Install native mode (host tools)"
@echo ""
@echo "Test:"
@echo " make test Run all tests"
@echo " make test-cli Test termote.sh CLI"
@echo " make test-get Test get.sh online installer"
@echo " make test-entrypoints Test entrypoint scripts"
@echo ""
@echo "Release:"
@echo " make release Tag and push new release (VERSION=x.y.z)"
@echo " make release-dry Show what would be released"
@echo ""
@echo "Format:"
@echo " make fmt Format markdown/mdx files (dprint)"
@echo " make fmt-check Check markdown/mdx formatting"
@echo ""
@echo "Other:"
@echo " make health Check service health"
@echo " make clean Stop and remove containers"
@echo " make uninstall Uninstall all"
# Build targets
build: build-pwa build-api
build-pwa:
@echo "Building PWA..."
pnpm install --frozen-lockfile --filter termote...
pnpm --filter termote build
build-api:
@echo "Building tmux-api..."
cd tmux-api && CGO_ENABLED=0 go build -ldflags="-s -w" -o tmux-api .
# Install targets (uses unified CLI)
install-container:
./scripts/termote.sh install container
install-container-lan:
./scripts/termote.sh install container --lan
install-native:
./scripts/termote.sh install native
install-native-lan:
./scripts/termote.sh install native --lan
# Test targets
test: test-cli test-get test-entrypoints
@echo ""
@echo "All tests completed!"
test-cli:
@chmod +x tests/test-termote.sh
@./tests/test-termote.sh
test-get:
@chmod +x tests/test-get.sh
@./tests/test-get.sh
test-entrypoints:
@chmod +x tests/test-entrypoints.sh
@./tests/test-entrypoints.sh
# Format targets (dprint)
fmt:
npx dprint fmt
fmt-check:
npx dprint check
# Health check
health:
./scripts/termote.sh health
# Container runtime detection
CONTAINER_RT := $(shell command -v podman 2>/dev/null || command -v docker 2>/dev/null)
# Cleanup
clean:
$(CONTAINER_RT) compose down 2>/dev/null || true
$(CONTAINER_RT) stop termote 2>/dev/null || true
$(CONTAINER_RT) rm termote 2>/dev/null || true
rm -f docker-compose.override.yml
uninstall:
./scripts/termote.sh uninstall all
# Release targets
release-dry:
@echo "=== Current version ===" && \
grep '"version"' pwa/package.json && \
echo "" && \
echo "=== Recent tags ===" && \
(git tag --sort=-version:refname | head -5 || echo "(no tags)") && \
echo "" && \
echo "=== Unreleased commits ===" && \
git --no-pager log $$(git describe --tags --abbrev=0 2>/dev/null || echo "HEAD~10")..HEAD --oneline
release:
@if [ -z "$(VERSION)" ]; then \
echo "Usage: make release VERSION=1.2.3"; \
exit 1; \
fi
@echo "Creating release v$(VERSION)..."
git tag -a "v$(VERSION)" -m "Release v$(VERSION)"
git push origin "v$(VERSION)"
@echo ""
@echo "Release v$(VERSION) triggered!"
@echo "Monitor: https://github.com/lamngockhuong/termote/actions"