forked from jfrog/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (62 loc) · 2.02 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
# Lint charts locally
MAC_ARGS ?=
CHARTS_REPO ?= https://github.com/jfrog/charts
CHART_TESTING_IMAGE ?= releases-docker.jfrog.io/charts-ci
CHART_TESTING_TAG ?= 0.1.0
HELM_VERSION ?= v3.11.1
# If the first argument is "lint" or "mac" or "gke" or "kind"
ifneq ( $(filter wordlist 1,lint mac gke kind), $(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "lint" "mac" or "gke" or "kind"
MAC_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(MAC_ARGS):;@:)
endif
# check for binaries
HELM_CMD := $(shell command -v helm 2> /dev/null)
KUBECTL_CMD := $(shell command -v kubectl 2> /dev/null)
KUBEVAL_CMD := $(shell command -v kubeval 2> /dev/null)
GCLOUD_CMD := $(shell command -v gcloud 2> /dev/null)
.PHONY: check-cli
check-cli: check-helm check-kubectl check-kubeval
.PHONY: check-helm
check-helm:
ifndef HELM_CMD
$(error "$n$nNo helm command found! $n$nPlease download required helm binary.$n$n")
endif
.PHONY: check-kubectl
check-kubectl:
ifndef KUBECTL_CMD
$(error "$n$nNo kubectl command found! $n$nPlease download required kubectl binary.$n$n")
endif
.PHONY: check-kubeval
check-kubeval:
ifndef KUBEVAL_CMD
$(error "$n$nNo kubeval command found! $n$nPlease install: brew tap instrumenta/instrumenta && brew install kubeval $n$n")
endif
.PHONY: check-gcloud
check-gcloud:
ifndef GCLOUD_CMD
$(error "$n$nNo gcloud command found! $n$nPlease download required gcloud SDK.$n$n")
endif
.PHONY: lint
lint: check-cli
$(eval export CHART_TESTING_TAG)
$(eval export CHARTS_REPO)
$(eval export CHART_TESTING_ARGS=${MAC_ARGS})
$(eval export HELM_VERSION)
$(eval export LOCAL_RUN=true)
test/lint-charts.sh
.PHONY: mac
mac:
$(eval export CHART_TESTING_TAG)
$(eval export CHARTS_REPO)
$(eval export CHART_TESTING_ARGS=${MAC_ARGS})
$(eval export LOCAL_RUN=true)
test/e2e-docker4mac.sh
.PHONY: gke
gke: check-gcloud
$(eval export CHART_TESTING_TAG)
$(eval export CHARTS_REPO)
$(eval export CHART_TESTING_ARGS=${MAC_ARGS})
$(eval export LOCAL_RUN=true)
test/e2e-local-gke.sh