-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
31 lines (30 loc) · 1.03 KB
/
Copy pathmakefile
File metadata and controls
31 lines (30 loc) · 1.03 KB
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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=hatbox
BINARY_UNIX=$(BINARY_NAME)_unix
all: test build
build:
$(GOBUILD) -o ./bin/$(BINARY_NAME) -v
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o ./bin/$(BINARY_UNIX) -v
test:
$(GOTEST) -v ./...
clean:
$(GOCLEAN)
rm -f ./bin/$(BINARY_NAME)
run: build
./bin/$(BINARY_NAME) --config hatbox1.config
image: build-linux
docker build ./ -t jaeg/hatbox:latest
docker tag jaeg/hatbox:latest jaeg/hatbox:$(shell git describe --abbrev=0 --tags)-$(shell git rev-parse --short HEAD)
publish:
docker push jaeg/hatbox:latest
docker push jaeg/hatbox:$(shell git describe --abbrev=0 --tags)-$(shell git rev-parse --short HEAD)
release:
docker tag jaeg/hatbox:$(shell git describe --abbrev=0 --tags)-$(shell git rev-parse --short HEAD) jaeg/hatbox:$(shell git describe --abbrev=0 --tags)
docker push jaeg/hatbox:$(shell git describe --abbrev=0 --tags)
docker push jaeg/hatbox:latest