-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMakefile
31 lines (24 loc) · 920 Bytes
/
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
BINARY = pushprom
PROJECT = pushprom
VERSION = $(shell git rev-list HEAD | wc -l |tr -d ' ')
HASH = $(shell git rev-parse --short HEAD)
GO = go
all:
@echo "make container # Create a Docker container for $(PROJECT)"
@echo
@echo "make test # Run the test suite"
release_linux:
go mod download
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "-s -w" -o "bin/pushprom-$(VERSION).linux-amd64/pushprom" github.com/messagebird/pushprom
mv bin/pushprom-$(VERSION).linux-amd64/pushprom bin/
rm -rf bin/pushprom-$(VERSION).linux-amd64/
file bin/pushprom
native:
go clean
go mod download
CGO_ENABLED=0 go build -ldflags "-s -w" -o "bin/pushprom-native" github.com/messagebird/pushprom
file bin/pushprom-native
container:
echo "* Creating $(PROJECT) Docker container"
DOCKER_BUILDKIT=1 docker build -t $(PROJECT):$(VERSION) .
docker tag $(PROJECT):$(VERSION) $(PROJECT):latest