-
Notifications
You must be signed in to change notification settings - Fork 475
/
Makefile
156 lines (132 loc) · 6.01 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
.PHONY: local publish-buildx publish-buildx-all namespaces install charts start-kind stop-kind build-buildx build-buildx-all render-charts verify-charts verify-chart charts-only bump-charts
IMG_NAME?=faas-netes
VERBOSE?=false
TAG?=latest
OWNER?=openfaas
SERVER?=ttl.sh
export DOCKER_CLI_EXPERIMENTAL=enabled
export DOCKER_BUILDKIT=1
VERSION := $(shell git describe --tags --dirty --always)
GIT_COMMIT := $(shell git rev-parse HEAD)
all: build-docker
local:
CGO_ENABLED=0 GOOS=linux go build -o faas-netes
build-docker:
docker build \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg VERSION=$(VERSION) \
-t $(SERVER)/$(OWNER)/$(IMG_NAME):$(TAG) .
.PHONY: build-buildx
build-buildx:
@echo $(SERVER)/$(OWNER)/$(IMG_NAME):$(TAG) && \
docker buildx create --use --name=multiarch --node=multiarch && \
docker buildx build \
--output "type=image,push=false" \
--platform linux/amd64 \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg VERSION=$(VERSION) \
--tag $(SERVER)/$(OWNER)/$(IMG_NAME):$(TAG) \
.
.PHONY: build-buildx-all
build-buildx-all:
@docker buildx create --use --name=multiarch --node=multiarch && \
docker buildx build \
--platform linux/amd64,linux/arm/v7,linux/arm64 \
--output "type=image,push=false" \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg VERSION=$(VERSION) \
--tag $(SERVER)/$(OWNER)/$(IMG_NAME):$(TAG) \
.
.PHONY: publish-buildx-all
publish-buildx-all:
@echo $(SERVER)/$(OWNER)/$(IMG_NAME):$(TAG) && \
docker buildx create --use --name=multiarch --node=multiarch && \
docker buildx build \
--platform linux/amd64,linux/arm/v7,linux/arm64 \
--push=true \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg VERSION=$(VERSION) \
--tag $(SERVER)/$(OWNER)/$(IMG_NAME):$(TAG) \
.
.PHONY: publish-buildx
publish-buildx:
@echo $(SERVER)/$(OWNER)/$(IMG_NAME):$(TAG) && \
docker buildx create --use --name=multiarch --node=multiarch && \
docker buildx build \
--platform linux/amd64 \
--push=true \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg VERSION=$(VERSION) \
--tag $(SERVER)/$(OWNER)/$(IMG_NAME):$(TAG) \
.
charts: verify-charts charts-only
verify-charts:
@echo Verifying helm charts images in remote registries && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/openfaas/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/kafka-connector/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/cron-connector/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/nats-connector/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/mqtt-connector/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/pro-builder/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/sqs-connector/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/postgres-connector/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/queue-worker/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/sns-connector/values.yaml && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/rabbitmq-connector/values.yaml
verify-chart:
@echo Verifying helm chart images in remote registries && \
arkade chart verify --verbose=$(VERBOSE) -f ./chart/openfaas/values.yaml
# Only upgrade the openfaas chart, for speed
upgrade-chart:
@echo Upgrading openfaas helm chart images && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/openfaas/values.yaml
upgrade-charts:
@echo Upgrading images for all helm charts && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/openfaas/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/kafka-connector/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/cron-connector/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/nats-connector/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/mqtt-connector/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/pro-builder/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/sqs-connector/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/postgres-connector/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/queue-worker/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/sns-connector/values.yaml && \
arkade chart upgrade --verbose=$(VERBOSE) -w -f ./chart/rabbitmq-connector/values.yaml
bump-charts:
arkade chart bump --file ./chart/openfaas/Chart.yaml -w && \
arkade chart bump --file ./chart/kafka-connector/Chart.yaml -w && \
arkade chart bump --file ./chart/cron-connector/Chart.yaml -w && \
arkade chart bump --file ./chart/nats-connector/Chart.yaml -w && \
arkade chart bump --file ./chart/mqtt-connector/Chart.yaml -w && \
arkade chart bump --file ./chart/pro-builder/Chart.yaml -w && \
arkade chart bump --file ./chart/sqs-connector/Chart.yaml -w && \
arkade chart bump --file ./chart/postgres-connector/Chart.yaml -w && \
arkade chart bump --file ./chart/queue-worker/Chart.yaml -w && \
arkade chart bump --file ./chart/sns-connector/Chart.yaml -w && \
arkade chart bump --file ./chart/rabbitmq-connector/Chart.yaml -w
charts-only:
@cd chart && \
helm package openfaas/ && \
helm package kafka-connector/ && \
helm package cron-connector/ && \
helm package nats-connector/ && \
helm package mqtt-connector/ && \
helm package pro-builder/ && \
helm package sqs-connector/ && \
helm package postgres-connector/ && \
helm package queue-worker/ && \
helm package sns-connector/ && \
helm package rabbitmq-connector/
mv chart/*.tgz docs/
helm repo index docs --url https://openfaas.github.io/faas-netes/ --merge ./docs/index.yaml
start-kind: ## attempt to start a new dev environment
@./contrib/create_dev.sh
stop-kind: ## attempt to stop the dev environment
@./contrib/stop_dev.sh
.PHONY: verify-codegen
verify-codegen:
./hack/verify-codegen.sh
.PHONY: update-codegen
update-codegen:
./hack/update-codegen.sh