-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
761 additions
and
597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CGO_ENABLED=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#https://gqlxj1987.github.io/2018/08/14/good-makefile-golang/ | ||
include .env | ||
|
||
PROJECT=socks5lb | ||
VERSION=$(shell date +%Y%m%d) | ||
COMMIT_HASH=$(shell git rev-parse --short HEAD) | ||
SRC=./cmd/$(PROJECT) | ||
BINARY=$(PROJECT) | ||
GO=$(shell which go) | ||
GO_FLAGS=-ldflags="\ | ||
-X 'github.com/mingcheng/socks5lb.Version=$(VERSION)' \ | ||
-X 'github.com/mingcheng/socks5lb.BuildCommit=$(COMMIT_HASH)' \ | ||
-X 'github.com/mingcheng/socks5lb.BuildDate=$(shell date)'" | ||
|
||
|
||
|
||
# Make is verbose in Linux. Make it silent. | ||
MAKEFLAGS += --silent | ||
|
||
all: build | ||
|
||
build: $(SRC) | ||
@$(GO) build $(GO_FLAGS) -o ${BINARY} $(SRC) | ||
|
||
test: | ||
@go test -v ./... | ||
|
||
docker_image_build: | ||
@docker-compose build | ||
|
||
docker_image_push: docker_image_build | ||
@docker-compose push | ||
|
||
clean: | ||
@$(GO) clean ./... | ||
@rm $(BINARY) | ||
|
||
.PHONY: install test clean docker_image_build docker_image_push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.