-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (42 loc) · 1.58 KB
/
Makefile
File metadata and controls
59 lines (42 loc) · 1.58 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
BINARY_NAME := fioup
BUILD_DIR := bin
MAIN := ./cmd/fioup
LINTER = golangci-lint
TAGS = disable_pkcs11
DEBS_DIR ?= $(BUILD_DIR)
PKG := main
VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7 --match "v*" 2>/dev/null || echo "dev")
COMMIT ?= $(shell git rev-parse --short=7 HEAD 2>/dev/null || echo "none")
DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
LDFLAGS := -X '$(PKG).Version=$(VERSION)' -X '$(PKG).Commit=$(COMMIT)' -X '$(PKG).Date=$(DATE)'
.PHONY: all build clean test format manpages bash-completion
all: build manpages bash-completion
build:
@go build -ldflags "$(LDFLAGS)" -o $(BUILD_DIR)/$(BINARY_NAME) -tags $(TAGS) $(MAIN)
manpages:
@GOOS= GOARCH= \
go run -tags disable_pkcs11,disable_main $(MAIN) manpages $(BUILD_DIR)/man
bash-completion:
@GOOS= GOARCH= \
go run -tags disable_pkcs11,disable_main $(MAIN) bash-completion $(BUILD_DIR)/bash-completion
deb:
docker build --progress=plain --output $(DEBS_DIR) -f debian/Dockerfile .
format:
@go fmt ./...
check: format
$(LINTER) run
test:
@go test -tags $(TAGS) ./pkg/...
test-e2e-single-command:
pytest test/e2e/e2e-test.py --maxfail=1 -vv -k 'test_incremental_updates[False-False-True'
test-e2e-granular:
pytest test/e2e/e2e-test.py --maxfail=1 -vv -k 'test_incremental_updates[False-True-False'
test-e2e-daemon:
pytest test/e2e/e2e-test.py --maxfail=1 -vv -k 'test_fioup_daemon'
test-e2e: test-e2e-granular test-e2e-single-command
preload-images:
test/fixtures/preload-images.sh
test-integration: preload-images
@go test -timeout 30m -v ./test/integration/ -tags $(TAGS)
clean:
@rm -rf $(BUILD_DIR)