-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (25 loc) · 1.09 KB
/
Makefile
File metadata and controls
33 lines (25 loc) · 1.09 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
BINARY := stepsecurity-dev-machine-guard
MODULE := github.com/step-security/dev-machine-guard
VERSION := $(shell grep -m1 'Version' internal/buildinfo/version.go | sed 's/.*"//;s/".*//')
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown")
TAG := $(shell git describe --tags --exact-match 2>/dev/null || echo "dev")
LDFLAGS := -s -w \
-X $(MODULE)/internal/buildinfo.GitCommit=$(COMMIT) \
-X $(MODULE)/internal/buildinfo.ReleaseTag=$(TAG) \
-X $(MODULE)/internal/buildinfo.ReleaseBranch=$(BRANCH)
.PHONY: build build-windows deploy-windows test lint clean smoke
build:
go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/stepsecurity-dev-machine-guard
build-windows:
GOOS=windows GOARCH=amd64 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY).exe ./cmd/stepsecurity-dev-machine-guard
deploy-windows:
@bash scripts/deploy-windows.sh $(DEPLOY_ARGS)
test:
go test ./... -v -race -count=1
lint:
golangci-lint run ./...
clean:
rm -f $(BINARY)
smoke: build
bash tests/test_smoke_go.sh