You've already forked netbird-kubeapi-proxy
mirror of
https://github.com/netbirdio/netbird-kubeapi-proxy.git
synced 2026-05-22 18:44:56 -07:00
1724c9384c
Co-authored-by: Shyam <shyam0904a@users.noreply.github.com>
30 lines
937 B
Makefile
30 lines
937 B
Makefile
IMG_REGISTRY ?= ghcr.io
|
|
IMG_REPOSITORY ?= netbirdio/netbird-kubeapi-proxy
|
|
IMG_TAG ?= dev
|
|
IMG_REF := $(IMG_REGISTRY)/$(IMG_REPOSITORY):$(IMG_TAG)
|
|
|
|
.PHONY: lint
|
|
lint:
|
|
@golangci-lint run ./...
|
|
|
|
.PHONY: build
|
|
build: bin/linux-$(shell go env GOARCH)/netbird-kubeapi-proxy
|
|
|
|
bin/linux-%/netbird-kubeapi-proxy: $(shell find internal) main.go go.mod go.sum
|
|
@CGO_ENABLED=0 GOOS=linux GOARCH=$* go build -ldflags="-w -s" -trimpath -o $@ main.go
|
|
|
|
.PHONY: build-image
|
|
build-image: build
|
|
@DOCKER_BUILDKIT=1 docker build -t ${IMG_REF} .
|
|
@echo ${IMG_REF}
|
|
|
|
.PHONY: build-image-multiarch
|
|
build-image-multiarch: bin/linux-amd64/netbird-kubeapi-proxy bin/linux-arm64/netbird-kubeapi-proxy
|
|
@DOCKER_BUILDKIT=1 docker build --platform linux/amd64,linux/arm64 -t ${IMG_REF} .
|
|
@echo ${IMG_REF}
|
|
|
|
deploy: build-image
|
|
kind load docker-image ${IMG_REF}
|
|
kustomize build manifests | kubectl apply -f -
|
|
kubectl rollout restart deployment/netbird-kubeapi-proxy
|