forked from rbramwell/helm.astronomer.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (58 loc) · 1.77 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
# Public repository for charts.
DOMAIN ?= helm.astronomer.io
URL ?= https://${DOMAIN}
BUCKET ?= gs://${DOMAIN}
# Version
ASTRONOMER_MAJOR_VERSION ?= 0
ASTRONOMER_MINOR_VERSION ?= 4
ASTRONOMER_PATCH_VERSION ?= 2
ASTRONOMER_VERSION ?= ${ASTRONOMER_MAJOR_VERSION}.${ASTRONOMER_MINOR_VERSION}.${ASTRONOMER_PATCH_VERSION}
# List of charts to build
CHARTS := astronomer airflow grafana prometheus nginx
# Output directory
OUTPUT := repository
.PHONY: build
build:
mkdir -p ${OUTPUT}
for chart in ${CHARTS} ; do \
helm package --version ${ASTRONOMER_VERSION} -d ${OUTPUT} charts/$${chart} || exit 1; \
done; \
$(MAKE) build-index
.PHONY: build-index
build-index:
helm repo index ${OUTPUT} --url ${URL}
.PHONY: push
push: build
@read -p "Are you sure you want to push a production release? Ctrl+c to abort." ans;
$(MAKE) push-repo
.PHONY: push-repo
push-repo:
for chart in ${CHARTS} ; do \
gsutil cp -a public-read ${OUTPUT}/$${chart}-${ASTRONOMER_VERSION}.tgz ${BUCKET} || exit 1; \
done; \
$(MAKE) push-index
.PHONY: push-index
push-index: build-index
gsutil cp -a public-read ${OUTPUT}/index.yaml ${BUCKET}
.PHONY: clean
clean:
for chart in ${CHARTS} ; do \
rm ${OUTPUT}/$${chart}-${ASTRONOMER_VERSION}.tgz || exit 1; \
done; \
.PHONY: build-rc
build-rc:
ifndef ASTRONOMER_RC_VERSION
$(error ASTRONOMER_RC_VERSION must be defined)
endif
$(MAKE) ASTRONOMER_VERSION=${ASTRONOMER_VERSION}-rc.${ASTRONOMER_RC_VERSION} build
.PHONY: push-rc
push-rc: build-rc
$(MAKE) ASTRONOMER_VERSION=${ASTRONOMER_VERSION}-rc.${ASTRONOMER_RC_VERSION} push-repo
.PHONY: clean-rc
clean-rc:
ifndef ASTRONOMER_RC_VERSION
$(error ASTRONOMER_RC_VERSION must be defined)
endif
for chart in ${CHARTS} ; do \
rm ${OUTPUT}/$${chart}-${ASTRONOMER_VERSION}-rc.${ASTRONOMER_RC_VERSION}.tgz || exit 1; \
done; \