Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (61 loc) · 2.61 KB
/
Copy pathMakefile
File metadata and controls
78 lines (61 loc) · 2.61 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
# warmbox — self-hosted GUI desktop orchestrator (vfkit + noVNC)
WARMBOX_HOME ?= $(HOME)/.warmbox
BINARY ?= warmbox
# A local build is not a release, so it says so: the update check then stays
# quiet instead of comparing a dev tree against published tags. Releases get
# their version from the tag — goreleaser passes -X main.version={{ .Tag }}.
VERSION ?= dev
# Which image the guest-image / image-pack targets act on. The images themselves
# are defined in deploy/images/ — `./warmbox image build` lists them.
IMAGE_NAME ?= xfce
.PHONY: build build-all web web-dev guest-image setup daemon run test vet clean install image-pack release-snapshot
## build: compile the warmbox binary (embeds the committed web/dist).
## CGO off keeps it a static, portable binary (and avoids SDK/toolchain drift).
build:
CGO_ENABLED=0 go build -ldflags "-X main.version=$(VERSION)" -o $(BINARY) ./cmd/warmbox
## web: build the dashboard SPA into web/dist
web:
cd web && npm install --no-audit --no-fund
cd web && npm run build
## web-dev: run the dashboard dev server (proxies /api to :7070)
web-dev:
cd web && npm run dev
## build-all: rebuild the SPA, then the binary that embeds it
build-all: web build
## install: build, install to ~/.local/bin, and re-sign (macOS kills an arm64
## binary whose ad-hoc signature a plain copy invalidated)
install: build
mkdir -p $(HOME)/.local/bin
install -m755 $(BINARY) $(HOME)/.local/bin/$(BINARY)
-codesign --force --sign - $(HOME)/.local/bin/$(BINARY)
## guest-image: build IMAGE_NAME from the registry (see deploy/images/)
guest-image: build
./$(BINARY) image build $(IMAGE_NAME)
## setup: fetch noVNC and check prerequisites (requires the guest image)
setup: build
./$(BINARY) setup
## daemon: run the orchestrator (warm pool + REST API)
daemon: build
./$(BINARY) daemon
## run: build everything and start the daemon
run: guest-image build
./$(BINARY) daemon
## test: run the Go test suite
test:
go test ./...
## smoke: boot IMAGE_NAME with the real daemon and wait for it to report ready
## (the check that would catch a guest that does not boot, before a release)
smoke: build
WARMBOX_BIN=./$(BINARY) ./deploy/guest/smoke.sh $(IMAGE_NAME)
## vet: run go vet
vet:
go vet ./...
## clean: remove local build artifacts (not the guest image)
clean:
rm -f $(BINARY)
## image-pack: pack IMAGE_NAME for the "images" release (also writes .sha256)
image-pack: build
./$(BINARY) image pack $(IMAGE_NAME) -o warmbox-image-$(IMAGE_NAME)-$(shell go env GOARCH).tar.zst
## release-snapshot: dry-run a release locally (builds every target, publishes nothing)
release-snapshot:
goreleaser release --snapshot --clean