forked from submariner-io/submariner-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (62 loc) · 2.27 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
BASE_BRANCH ?= devel
export BASE_BRANCH
ifneq (,$(DAPPER_HOST_ARCH))
# Running in Dapper
PRELOAD_IMAGES := submariner-gateway submariner-operator submariner-route-agent lighthouse-agent lighthouse-coredns
include $(SHIPYARD_DIR)/Makefile.inc
ifneq (,$(filter ovn,$(_using)))
CLUSTER_SETTINGS_FLAG = --settings $(DAPPER_SOURCE)/.shipyard.e2e.ovn.yml
else
CLUSTER_SETTINGS_FLAG = --settings $(DAPPER_SOURCE)/.shipyard.e2e.yml
endif
override CLUSTERS_ARGS += $(CLUSTER_SETTINGS_FLAG)
override DEPLOY_ARGS += $(CLUSTER_SETTINGS_FLAG) --deploytool helm
export DEPLOY_ARGS
GH_URL=https://submariner-io.github.io/submariner-charts/charts
CHARTS_DIR=charts
CHARTS_VERSION=0.10.1
HELM_DOCS_VERSION=0.15.0
REPO_URL=$(shell git config remote.origin.url)
# Process extra flags from the `using=a,b,c` optional flag
ifneq (,$(filter lighthouse,$(_using)))
override DEPLOY_ARGS += --service_discovery
endif
ifneq (,$(filter globalnet,$(_using)))
override DEPLOY_ARGS += --globalnet
endif
# Targets to make
e2e: E2E_ARGS=cluster1 cluster2
%.tgz:
helm dep update $(subst -$(CHARTS_VERSION),,$(basename $(@F)))
helm package --version $(CHARTS_VERSION) $(subst -$(CHARTS_VERSION),,$(basename $(@F)))
helm-docs:
# Avoid polluting repo with helm-docs' README/LICENSE or other files in the release archive
cd /tmp && \
curl -sL https://github.com/norwoodj/helm-docs/releases/download/v$(HELM_DOCS_VERSION)/helm-docs_$(HELM_DOCS_VERSION)_Linux_x86_64.tar.gz | tar zx && \
cd -
/tmp/helm-docs
if [ ! -z $(git status --porcelain) ]; then \
echo "Helm docs not up-to-date:"; \
git status --porcelain; \
git diff; \
echo "Run make helm-docs locally to generate updated docs, commit the updates."; \
exit 1; \
fi
release: submariner-k8s-broker-$(CHARTS_VERSION).tgz submariner-operator-$(CHARTS_VERSION).tgz
git checkout gh-pages
mv *.tgz $(CHARTS_DIR)
if [ -f $(CHARTS_DIR)/index.yaml ]; then \
helm repo index $(CHARTS_DIR) --url $(GH_URL) --merge $(CHARTS_DIR)/index.yaml; \
else \
helm repo index $(CHARTS_DIR) --url $(GH_URL); \
fi
.PHONY: release helm-docs
else
# Not running in Dapper
Makefile.dapper:
@echo Downloading $@
@curl -sfLO https://raw.githubusercontent.com/submariner-io/shipyard/$(BASE_BRANCH)/$@
include Makefile.dapper
endif
# Disable rebuilding Makefile
Makefile Makefile.inc: ;