-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (41 loc) · 1.28 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/make
# include envfile
# export $(shell sed 's/=.*//' envfile)
SHELL = /bin/bash
working_dir = $(shell pwd)
build_hostname = $(shell hostname)
build_time = $(shell date +'%FT%T.%N%:z')
git_repository = $(shell git config --get remote.origin.url)
git_branch = $(shell git rev-parse --abbrev-ref HEAD)
git_commit_id = $(shell git rev-parse --verify HEAD)
git_commit_time = $(shell git log -1 --format="%at" | xargs -I{} date -d @{} +%FT%T%:z)
lint:
go mod tidy
if [ -d vendor ]; then go mod vendor; fi
go fmt ./...
go vet ./...
build:
mkdir -p target
go build -o target/main main.go
ls -al target/
release:
release=true deploy/go_build.sh
ls -al target
ssh:
make build
./target/main ssh -config=configs/local.yaml -addr=127.0.0.1:1081
server:
make build
./target/main server -addr=127.0.0.1:1091
socks5_proxy:
config=configs/ssh.conf ./bin/socks5_ssh.sh remote_host 127.0.0.1:1081
noauth:
make build
./target/main ssh -config=configs/local.yaml -subkey=noauth -addr=127.0.0.1:1081
test:
curl -k -x 'socks5h://hello:world@127.0.0.1:1081' https://icanhazip.com
image-local:
region=cn DOCKER_Pull=false DOCKER_Tag=local DOCKER_Push=false GIT_Pull=false \
bash deploy/build.sh dev
image-dev:
region=cn DOCKER_Pull=false DOCKER_Tag=dev DOCKER_Push=false bash deploy/build.sh dev