-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (49 loc) · 1.96 KB
/
Copy pathMakefile
File metadata and controls
63 lines (49 loc) · 1.96 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
LOCAL_ENV = AWS_ACCESS_KEY_ID=minioadmin AWS_SECRET_ACCESS_KEY=minioadmin \
AWS_REGION=us-east-1 CLICK_S3_ENDPOINT=http://localhost:9000 \
CLICK_API_URL=http://127.0.0.1:8080
# The auth overlay adds oauth2-proxy + dex and turns on nginx auth_request.
# down/clean always use both files so either stack tears down fully.
COMPOSE_AUTH = docker compose -f docker-compose.yml -f docker-compose.auth.yml
.PHONY: build vet lint test cover up up-auth down examples smoke smoke-auth clean
build:
go build -o bin/click ./cmd/click
go build -o bin/clickd ./cmd/clickd
# Static analysis over every package — the same check CI's `checks` job runs.
vet:
go vet ./...
# The layer above vet: errcheck, staticcheck, ineffassign and unused, with the
# exclusions .golangci.yml explains. Not a Go tool, so it needs installing —
# and a missing binary should say so rather than fail as a bare "command not
# found" in the middle of a build.
lint:
@command -v golangci-lint >/dev/null || { \
echo "golangci-lint not installed — brew install golangci-lint (see https://golangci-lint.run)"; \
exit 1; }
golangci-lint run ./...
# Hermetic Go unit tests — no Docker, no network. `-short` skips the one
# deliberately slow case (internal/db's 30-attempt connect retry).
test:
go test ./...
cover:
go test ./... -coverprofile=coverage.out
go tool cover -func=coverage.out | tail -1
@echo "detail: go tool cover -html=coverage.out"
up:
docker compose up -d --build
up-auth:
$(COMPOSE_AUTH) up -d --build
down:
$(COMPOSE_AUTH) down
examples: build
$(LOCAL_ENV) ./bin/click deploy examples/hello --name hello
$(LOCAL_ENV) ./bin/click deploy examples/dashboard --name dashboard
$(LOCAL_ENV) ./bin/click deploy examples/guestbook --name guestbook
$(LOCAL_ENV) ./bin/click deploy examples/demo --name demo
$(LOCAL_ENV) ./bin/click deploy examples/retro --name retro
smoke:
./scripts/smoke.sh
smoke-auth:
./scripts/smoke-auth.sh
clean:
rm -rf bin
$(COMPOSE_AUTH) down -v