forked from rudderlabs/rudder-server
/
Makefile
44 lines (29 loc) · 1.23 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
.PHONY: help run test enterprise-init enterprise-update-commit enterprise-prepare-build
GO=go
GINKGO=ginkgo
include .enterprise/env
echo:
echo $(ENTERPRISE_COMMIT_FILE)
echo $(ENTERPRISE_COMMIT)
all: build
mocks: ## Generate all mocks
$(GO) generate ./...
test: enterprise-prepare-build mocks ## Run all unit tests
$(GINKGO) --randomizeAllSpecs -p --skipPackage=tests ./...
build: enterprise-prepare-build ## Build rudder-server binary
$(GO) build -o bin/rudder-server main.go
run: enterprise-prepare-build ## Run rudder-server-binary
$(GO) run -mod=vendor main.go
help: ## Show the available commands
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' ./Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# Enterprise version
enterprise-init: ## Initialise enterprise version
@.enterprise/scripts/init.sh
enterprise-update-commit: ## Updates linked enterprise commit to current commit in ENTERPRISE_DIR
@.enterprise/scripts/update-commit.sh
enterprise-prepare-build: ## Create ./imports/enterprise.go, to link enterprise packages in binary
@if [ -d "./$(ENTERPRISE_DIR)" ]; then \
$(ENTERPRISE_DIR)/import.sh ./$(ENTERPRISE_DIR) > ./imports/enterprise.go; \
else \
rm -f ./imports/enterprise.go; \
fi