-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
48 lines (39 loc) · 1.2 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
.PHONY: all build modules kube-module openshift-module clean resolve docker-image setup
PROJECT_DIR := $(shell pwd)
BUILD_DIR := $(PROJECT_DIR)/build
RELEASE_DIR := $(PROJECT_DIR)/release
TOOLS_DIR := $(PROJECT_DIR)/tools
VENDOR_DIR := $(PROJECT_DIR)/vendor
DOCS_DIR := $(PROJECT_DIR)/docs
all: clean resolve build modules
clean:
@echo "Cleaning project..."
@rm -rf $(BUILD_DIR)
@rm -rf $(RELEASE_DIR)
@rm -rf $(VENDOR_DIR)
@go clean -i
resolve:
@echo "Resolving dependencies..."
@dep ensure
build:
@echo "Building crunchy-watch..."
@go build -i -o $(BUILD_DIR)/crunchy-watch \
-ldflags='-s -w' \
$(PROJECT_DIR)/*.go
modules: kube-module
kube-module:
@echo "Building Kubernetes module..."
@go build -buildmode=plugin \
-o $(BUILD_DIR)/plugins/kube.so \
-ldflags='-s -w' \
plugins/kube/*.go
docker-image:
@echo "Building docker image..."
@docker build -t crunchy-watch \
-f $(CCP_BASEOS)/$(CCP_PGVERSION)/Dockerfile.watch.$(CCP_BASEOS) .
@docker tag crunchy-watch \
crunchydata/crunchy-watch:$(CCP_BASEOS)-$(CCP_PG_FULLVERSION)-$(CCP_VERSION)
setup:
@echo "Downloading tools..."
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
go get github.com/blang/expenv