Skip to content

Commit

Permalink
Merge branch 'feature/router'
Browse files Browse the repository at this point in the history
  • Loading branch information
wweir committed Feb 16, 2020
2 parents 8cd4fe5 + 899d64a commit dd4444b
Show file tree
Hide file tree
Showing 57 changed files with 1,335 additions and 2,200 deletions.
5 changes: 2 additions & 3 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ FROM golang:1.13-alpine AS compiler
RUN apk add --no-cache git make

# enable go modules
WORKDIR /workdir
WORKDIR /src
COPY . .

# do not worry about downloading dependency, sower will fix this.
RUN CGO_ENABLED=0 make build


# Build image
FROM scratch

COPY --from=compiler /workdir/sower /sower
COPY --from=compiler /src/sower /sower
ENTRYPOINT [ "/sower" ]
18 changes: 0 additions & 18 deletions .github/cc.wweir.sower.plist

This file was deleted.

127 changes: 0 additions & 127 deletions .github/install

This file was deleted.

14 changes: 0 additions & 14 deletions .github/sower-client.service

This file was deleted.

14 changes: 0 additions & 14 deletions .github/sower-server.service

This file was deleted.

20 changes: 0 additions & 20 deletions .github/uninstall

This file was deleted.

39 changes: 4 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,12 @@
export GO111MODULE=on
SERVER:=127.0.0.1:5533

default: test build

generate:
ifeq ("", "$(shell which stringer)")
@echo installing generator
go get -v golang.org/x/tools/cmd/stringer
endif
go generate ./...

test:
go vet ./...
go test ./...
go list ./... | grep -v internal | xargs go test
build:
go build -ldflags \
"-X main.version=$(shell git describe --tags) \
-X main.date=$(shell date +%Y-%m-%d)"
go build -ldflags "-w -s \
-X conf.version=$(shell git describe --tags) \
-X conf.date=$(shell date +%Y-%m-%d)"
image:
docker build -t sower -f .github/Dockerfile .

kill:
sudo pkill -9 sower || true

client: build kill
sudo $(PWD)/sower -s 127.0.0.1:5533 -H "127.0.0.1:8080"

server: build
$(PWD)/sower -f ''

run: build kill
$(PWD)/sower -f '' &
sudo $(PWD)/sower -f '' -s 127.0.0.1:5533 -H "127.0.0.1:8080" &

@sleep 1
HTTP_PROXY=http://127.0.0.1:8080 curl http://baidu.com || true
@echo
HTTPS_PROXY=http://127.0.0.1:8080 curl https://baidu.com || true
@echo

@sleep 1
@sudo pkill -9 sower || true
Loading

0 comments on commit dd4444b

Please sign in to comment.