forked from kubeshop/botkube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (57 loc) · 2.09 KB
/
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
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
.DEFAULT_GOAL := build
.PHONY: container-image test test-integration-slack test-integration-discord build pre-build publish lint lint-fix go-import-fmt system-check save-images load-and-push-images
# Show this help.
help:
@awk '/^#/{c=substr($$0,3);next}c&&/^[[:alpha:]][[:alnum:]_-]+:/{print substr($$1,1,index($$1,":")),c}1{c=0}' $(MAKEFILE_LIST) | column -s: -t
lint-fix: go-import-fmt
@go mod tidy
@go mod verify
@golangci-lint run --fix "./..."
go-import-fmt:
@./hack/fmt-imports.sh
# test
test: system-check
@go test -v -race ./...
test-integration-slack: system-check
@go test -v -tags=integration -race -count=1 ./test/... -run "TestSlack"
test-integration-discord: system-check
@go test -v -tags=integration -race -count=1 ./test/... -run "TestDiscord"
# Build the binary
build: pre-build
@cd cmd/botkube;GOOS_VAL=$(shell go env GOOS) CGO_ENABLED=0 GOARCH_VAL=$(shell go env GOARCH) go build -o $(shell go env GOPATH)/bin/botkube
@echo "Build completed successfully"
# Build the image
container-image: pre-build
@echo "Building docker image"
@./hack/goreleaser.sh build
@echo "Docker image build successful"
# Build the image
container-image-single: pre-build
@echo "Building single target docker image"
@./hack/goreleaser.sh build_single
@echo "Single target docker image build successful"
# Build project and push dev images with v9.99.9-dev tag
release-snapshot:
@./hack/goreleaser.sh release_snapshot
# Build project and save images with IMAGE_TAG tag
save-images:
@./hack/goreleaser.sh save_images
# Load project and push images with IMAGE_TAG tag
load-and-push-images:
@./hack/goreleaser.sh load_and_push_images
# system checks
system-check:
@echo "Checking system information"
@if [ -z "$(shell go env GOOS)" ] || [ -z "$(shell go env GOARCH)" ] ; \
then \
echo 'ERROR: Could not determine the system architecture.' && exit 1 ; \
else \
echo 'GOOS: $(shell go env GOOS)' ; \
echo 'GOARCH: $(shell go env GOARCH)' ; \
echo 'System information checks passed.'; \
fi ;
# Pre-build checks
pre-build: system-check
# Run chart lint & helm-docs
process-chart:
@./hack/process-chart.sh