-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (52 loc) · 2.26 KB
/
Copy pathMakefile
File metadata and controls
72 lines (52 loc) · 2.26 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
PROJECT ?=
SLUG ?=
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short=12 HEAD 2>/dev/null || echo unknown)
BUILD_DATE ?= $(shell git log -1 --format=%cI 2>/dev/null || date -u +%Y-%m-%dT%H:%M:%SZ)
BUILD_LDFLAGS := -s -w -X github.com/ifuryst/ard/internal/buildinfo.Version=$(VERSION) -X github.com/ifuryst/ard/internal/buildinfo.Commit=$(COMMIT) -X github.com/ifuryst/ard/internal/buildinfo.Date=$(BUILD_DATE)
.PHONY: init new-history new-plan fmt fmt-check check-public-surface test test-public-go-client test-integration test-e2e test-compose build console-dev console-build console-lint sbom package release-dry-run docker-build
init:
@if [ -z "$(PROJECT)" ]; then echo "usage: make init PROJECT=my-project"; exit 1; fi
./scripts/init-project.sh "$(PROJECT)"
new-history:
@if [ -z "$(SLUG)" ]; then echo "usage: make new-history SLUG=my-change"; exit 1; fi
./scripts/new-history.sh "$(SLUG)"
new-plan:
@if [ -z "$(SLUG)" ]; then echo "usage: make new-plan SLUG=my-plan"; exit 1; fi
./scripts/new-exec-plan.sh "$(SLUG)"
fmt:
gofmt -w cmd internal
fmt-check:
./scripts/check-fmt.sh
check-public-surface:
go run ./internal/tools/publicsurface
test:
go test ./...
test-public-go-client:
./scripts/test-public-go-client.sh
test-integration:
./scripts/test-integration.sh
test-e2e:
./scripts/test-e2e-artifacts.sh
test-compose: build
./scripts/test-compose.sh
build:
go build -trimpath -ldflags "$(BUILD_LDFLAGS)" -o bin/ard ./cmd/ard
go build -trimpath -ldflags "$(BUILD_LDFLAGS)" -o bin/ardctl ./cmd/ardctl
go build -trimpath -ldflags "$(BUILD_LDFLAGS)" -o bin/ard-server ./cmd/ard-server
console-dev:
npm run dev:console
console-build:
npm run build:console
console-lint:
npm run lint:console
sbom:
@mkdir -p dist
go run ./internal/tools/sbom -version "$${VERSION:-dev}" -created "$${CREATED:-1970-01-01T00:00:00Z}" -out dist/sbom.spdx.json
package:
./scripts/package-release.sh
release-dry-run:
@if [ "$(origin VERSION)" = "file" ]; then echo "usage: VERSION=v0.1.0 make release-dry-run"; exit 1; fi
VERSION="$(VERSION)" ./scripts/release-dry-run.sh
docker-build:
docker build --build-arg VERSION="$(VERSION)" --build-arg COMMIT="$(COMMIT)" --build-arg BUILD_DATE="$(BUILD_DATE)" -t ard:local .