-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
87 lines (68 loc) · 2.73 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
OS := $(shell uname)
UNAME_S := $(shell uname -s)
OS_SED :=
ifeq ($(UNAME_S),Darwin)
OS_SED += ""
endif
ifeq ($(OS),Darwin)
CONTAINERER=docker
else
CONTAINERER=podman
endif
CONTAINER_TAG="quay.io/cloudservices/ubi-hive"
KUBECTL=kubectl
NAMESPACE=default
help:
@echo "Please use \`make <target>' where <target> is one of:"
@echo ""
@echo "--- General Commands ---"
@echo "help show this message"
@echo "lint runs go lint on the project"
@echo "vet runs go vet on the project"
@echo "test runs go test on the project"
@echo "build builds the container image"
@echo "bonfire-config-local create bonfire config for deploying from your local repository"
@echo "bonfire-config-github create bonfire config for deploying from the github repository"
@echo "create-ns creates a namespace in kubernetes"
@echo " @param NAMESPACE - (optional) the namespace to use"
@echo "deploy-env creates a ClowdEnvironment in the given namespace"
@echo " @param NAMESPACE - (optional) the namespace to use"
@echo "deploy-app deploys the edge app in the given namespace"
@echo " @param NAMESPACE - (optional) the namespace to use"
@echo "scale-down scales the edge-api-service deployment down to 0 in the given namespace"
@echo " @param NAMESPACE - (optional) the namespace to use"
@echo "scale-up scales the edge-api-service deployment up to 1 in the given namespace"
@echo " @param NAMESPACE - (optional) the namespace to use"
@echo "restart-app scales the edge-api-service deployment down to 0 then up to 1 in the given namespace"
@echo " @param NAMESPACE - (optional) the namespace to use"
@echo ""
test:
go test $$(go list ./... | grep -v /test/) $(TEST_OPTIONS)
vet:
go vet $$(go list ./... | grep -v /vendor/)
lint:
golint $$(go list ./... | grep -v /vendor/)
build:
./docker-build-dev.sh
bump-image-tag:
./bump-image-tag.sh
bonfire-config-local:
@cp dev/default_config.yaml.local.example config.yaml
@sed -i ${OS_SED} 's|REPO|$(PWD)|g' config.yaml
bonfire-config-github:
@cp dev/default_config.yaml.github.example config.yaml
create-ns:
$(KUBECTL) create ns $(NAMESPACE)
deploy-env:
bonfire deploy-env -n $(NAMESPACE)
deploy-app:
bonfire deploy hccm -n $(NAMESPACE)
scale-down:
$(KUBECTL) scale --replicas=0 deployment/hive-metastore -n $(NAMESPACE)
scale-up:
$(KUBECTL) scale --replicas=1 deployment/hive-metastore -n $(NAMESPACE)
restart-app:
$(MAKE) scale-down NAMESPACE=$(NAMESPACE)
sleep 5
$(MAKE) scale-up NAMESPACE=$(NAMESPACE)
.PHONY: help build