forked from openfaas/faas-netes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (76 loc) · 3.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
.PHONY: build local push namespaces install charts start-kind stop-kind build-buildx render-charts
TAG?=latest
OWNER?=openfaas
export DOCKER_CLI_EXPERIMENTAL=enabled
TOOLS_DIR := .tools
GOPATH := $(shell go env GOPATH)
CODEGEN_VERSION := $(shell hack/print-codegen-version.sh)
CODEGEN_PKG := $(GOPATH)/pkg/mod/k8s.io/code-generator@${CODEGEN_VERSION}
all: build-docker
$(TOOLS_DIR)/code-generator.mod: go.mod
@echo "syncing code-generator tooling version"
@cd $(TOOLS_DIR) && go mod edit -require "k8s.io/code-generator@${CODEGEN_VERSION}"
${CODEGEN_PKG}: $(TOOLS_DIR)/code-generator.mod
@echo "(re)installing k8s.io/code-generator-${CODEGEN_VERSION}"
@cd $(TOOLS_DIR) && go mod download -modfile=code-generator.mod
local:
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o faas-netes
build-docker:
docker build \
-t ghcr.io/$(OWNER)/faas-netes:$(TAG) .
.PHONY: build-buildx
build-buildx:
@echo ghcr.io/$(OWNER)/faas-netes:$(TAG) && \
docker buildx create --use --name=multiarch --node=multiarch && \
docker buildx build \
--push \
--platform linux/amd64 \
--tag ghcr.io/$(OWNER)/faas-netes:$(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" \
--tag ghcr.io/$(OWNER)/faas-netes:$(TAG) \
.
.PHONY: publish-buildx-all
publish-buildx-all:
@echo ghcr.io/$(OWNER)/faas-netes:$(TAG) && \
docker buildx create --use --name=multiarch --node=multiarch && \
docker buildx build \
--platform linux/amd64,linux/arm/v7,linux/arm64 \
--push=true \
--tag ghcr.io/$(OWNER)/faas-netes:$(TAG) \
.
push:
docker push ghcr.io/$(OWNER)/faas-netes:$(TAG)
namespaces:
kubectl apply -f namespaces.yml
install: namespaces
kubectl apply -f yaml/
charts:
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/
mv chart/*.tgz docs/
helm repo index docs --url https://openfaas.github.io/faas-netes/ --merge ./docs/index.yaml
./contrib/create-static-manifest.sh
render-charts:
./contrib/create-static-manifest.sh
./contrib/create-static-manifest.sh ./chart/openfaas ./yaml_arm64 ./chart/openfaas/values-arm64.yaml
./contrib/create-static-manifest.sh ./chart/openfaas ./yaml_armhf ./chart/openfaas/values-armhf.yaml
start-kind: ## attempt to start a new dev environment
@./contrib/create_dev.sh \
&& echo "" \
&& printf '%-15s:\t %s\n' 'Web UI' 'http://localhost:31112/ui' \
&& printf '%-15s:\t %s\n' 'User' 'admin' \
&& printf '%-15s:\t %s\n' 'Password' $(shell cat password.txt) \
&& printf '%-15s:\t %s\n' 'CLI Login' "faas-cli login --username admin --password $(shell cat password.txt)"
stop-kind: ## attempt to stop the dev environment
@./contrib/stop_dev.sh
.PHONY: verify-codegen
verify-codegen: ${CODEGEN_PKG}
./hack/verify-codegen.sh
.PHONY: update-codegen
update-codegen: ${CODEGEN_PKG}
./hack/update-codegen.sh