-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 1.11 KB
/
Makefile
File metadata and controls
51 lines (38 loc) · 1.11 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
ifneq (,$(wildcard .env))
include .env
export $(shell sed 's/=.*//' .env)
endif
GO ?= go
GOBUILD = $(GO) build
GOCLEAN = $(GO) clean
GOTEST = $(GO) test
GOGET = $(GO) get
BINARY_NAME = proxyme
GOLANGCI_LINT_VERSION := v1.60.2
BIN_DIR := $(shell go env GOPATH)/bin
build:
$(GOBUILD) -o $(BINARY_NAME) .
run:
PROXY_NOAUTH=yes $(GO) run .
test:
$(GOTEST) -cover -count=1 ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
fmt:
$(GO) fmt ./...
lint:
$(GO) vet ./...
$(BIN_DIR)/golangci-lint run ./...
deps:
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BIN_DIR) $(GOLANGCI_LINT_VERSION)
@go install github.com/mattn/goveralls@latest
cover:
goveralls
docker-pub:
docker buildx build --platform linux/amd64,linux/arm64 -t docker.io/dblokhin/$(BINARY_NAME):latest -t docker.io/dblokhin/$(BINARY_NAME):$(shell git describe --tags --abbrev=0) --push .
docker-build:
docker build -t $(BINARY_NAME) .
docker-run:
docker run --rm -it -p 1080:1080 -e PROXY_NOAUTH=yes $(BINARY_NAME)
.PHONY: build clean test run fmt lint deps cover docker-pub docker-build docker-run