-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (26 loc) · 998 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
32
33
34
35
36
37
BIN := "./bin/resizer"
DOCKER_IMG := "resizer:lastest"
GIT_HASH := $(shell git log --format="%h" -n 1)
LDFLAGS := -X main.release="develop" -X main.buildDate=$(shell date -u +%Y-%m-%dT%H:%M:%S) -X main.gitHash=$(GIT_HASH)
build:
go build -v -o $(BIN) -ldflags "$(LDFLAGS)" ./cmd/resizer
version:
go $(BIN) -v
run: build
$(BIN) -c ./configs/config.toml
build-img:
docker build \
--build-arg=LDFLAGS="$(LDFLAGS)" \
-t $(DOCKER_IMG) \
-f build/Dockerfile .
run-img: build-img
docker run --publish 2891:2891 $(DOCKER_IMG)
run-compose:
docker-compose -f deployments/docker-compose.yml up -d resizer
install-lint-deps:
(which golangci-lint > /dev/null) || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.50.1
lint: install-lint-deps
golangci-lint run --skip-dirs docs ./...
test:
go test -v -count=1 -race -timeout=1m ./tests/...
.PHONY: build version run build-img run-img run-compose lint test