-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 889 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 889 Bytes
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
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 test lint clean smoke
build:
go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/stepsecurity-dev-machine-guard
test:
go test ./... -v -race -count=1
lint:
golangci-lint run ./...
clean:
rm -f $(BINARY)
smoke: build
bash tests/test_smoke_go.sh