File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,12 @@ Version := $(shell git describe --tags --dirty)
33GitCommit := $(shell git rev-parse HEAD)
44LDFLAGS := "-s -w -X main.Version=$(Version ) -X main.GitCommit=$(GitCommit ) "
55
6+
7+ SERVER? =ghcr.io
8+ OWNER? =openfaas
9+ IMG_NAME? =classic-watchdog
10+ TAG? =$(Version )
11+
612.PHONY : all
713all : gofmt test dist hashgen
814
2632 GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -ldflags $(LDFLAGS ) -installsuffix cgo -o bin/fwatchdog-arm64
2733 GOOS=windows CGO_ENABLED=0 go build -mod=vendor -a -ldflags $(LDFLAGS ) -installsuffix cgo -o bin/fwatchdog.exe
2834 GOOS=darwin CGO_ENABLED=0 go build -mod=vendor -a -ldflags $(LDFLAGS ) -installsuffix cgo -o bin/fwatchdog-darwin
35+
36+ # Example:
37+ # SERVER=docker.io OWNER=alexellis2 TAG=ready make publish
38+ .PHONY : publish
39+ publish :
40+ @echo $(SERVER ) /$(OWNER ) /$(IMG_NAME ) :$(TAG ) && \
41+ docker buildx create --use --name=multiarch --node=multiarch && \
42+ docker buildx build \
43+ --platform linux/amd64,linux/arm/v7,linux/arm64 \
44+ --push=true \
45+ --tag $(SERVER ) /$(OWNER ) /$(IMG_NAME ) :$(TAG ) \
46+ .
You can’t perform that action at this time.
0 commit comments