This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (54 loc) · 1.85 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
# Copyright 2017 Crunchy Data Solutions, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
.PHONY: all build clean clean-docs docs docker docker-push resolve install release run default
all: clean resolve build
RELEASE_VERSION := 1.0.0-beta
PROJECT_DIR := $(shell pwd)
BUILD_DIR := $(PROJECT_DIR)/build
DIST_DIR := $(PROJECT_DIR)/dist
VENDOR_DIR := $(PROJECT_DIR)/vendor
DOCS_DIR := $(PROJECT_DIR)/docs
BUILD_TARGET := $(PROJECT_DIR)/main.go
CRUNCHY_PROXY := crunchy-proxy
RELEASE_ARCHIVE := $(DIST_DIR)/crunchyproxy-$(RELEASE_VERSION).tar.gz
clean:
@echo "Cleaning project..."
@rm -rf $(DIST_DIR)
@rm -rf $(VENDOR_DIR)
@go clean -i
resolve:
@echo "Resolving depenencies..."
@glide up
build:
@echo "Building project..."
@go build -i -o $(BUILD_DIR)/$(CRUNCHY_PROXY)
install:
@go install
clean-docs:
@rm -rf $(DOCS_DIR)/pdf
docs:
@mkdir -p $(DOCS_DIR)/pdf
@cd docs && ./build-docs.sh
release: clean resolve build
@echo "Creating $(RELEASE_VERSION) release archive..."
@mkdir -p $(DIST_DIR)
@tar czf $(RELEASE_ARCHIVE) -C $(BUILD_DIR) $(CRUNCHY_PROXY)
@echo "Created: $(RELEASE_ARCHIVE)"
run:
@go run main.go --config=./examples/config.yaml
docker:
docker build -t crunchy-proxy -f Dockerfile.centos7 .
docker tag crunchy-proxy crunchydata/crunchy-proxy:centos7-$(RELEASE_VERSION)
docker-push:
docker push crunchydata/crunchy-proxy:centos7-$(RELEASE_VERSION)