File tree 1 file changed +18
-0
lines changed
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)
3
3
GitCommit := $(shell git rev-parse HEAD)
4
4
LDFLAGS := "-s -w -X main.Version=$(Version ) -X main.GitCommit=$(GitCommit ) "
5
5
6
+
7
+ SERVER? =ghcr.io
8
+ OWNER? =openfaas
9
+ IMG_NAME? =classic-watchdog
10
+ TAG? =$(Version )
11
+
6
12
.PHONY : all
7
13
all : gofmt test dist hashgen
8
14
26
32
GOARCH=arm64 CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -ldflags $(LDFLAGS ) -installsuffix cgo -o bin/fwatchdog-arm64
27
33
GOOS=windows CGO_ENABLED=0 go build -mod=vendor -a -ldflags $(LDFLAGS ) -installsuffix cgo -o bin/fwatchdog.exe
28
34
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