-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (30 loc) · 888 Bytes
/
Makefile
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
.PHONY: tidy clean test lint build install mockgen release-local
BUILD_VERSION=dev-snapshot
tidy:
@go mod tidy
@cd awsapis/ && go mod tidy
@cd awsapis_mocks/ && go mod tidy
clean:
@go clean -testcache
test:
@go test ./... -v
lint:
@golangci-lint run
build: clean
go build -ldflags="-X main.BuildVersion=$(BUILD_VERSION)" -o bin/aws-fail-az main.go
install: build
@mkdir -p ~/bin/
@cp bin/aws-fail-az ~/bin/aws-fail-az
@chmod 700 ~/bin/aws-fail-az
# Auto-generate AWS api mocks for unit testing
# IMPORTANT!! Run this target every time you need to modify the `awsapis` module
mockgen: ./awsapis/*.go
@for file in $^; do \
echo Generating mocks for $$file; \
mockgen -source $$file \
-package awsapis_mocks \
-destination awsapis_mocks/$$(basename $$file); \
done
@cd awsapis_mocks/ && go mod tidy
release-local:
@goreleaser release --snapshot --clean