From fea113fba47d66c34c4ddc2be6438aecce0f25d2 Mon Sep 17 00:00:00 2001 From: Gerson Alexander Pardo Gamez Date: Sat, 28 Sep 2019 08:08:35 -0500 Subject: [PATCH] split formulas and add dockerfile --- .goreleaser.yml | 35 ++++++++++++++++++++++++++++++++++- Dockerfile | 21 +++++++++++++++++++++ Makefile | 17 +++++++++++++++-- README.md | 11 ++++++++++- 4 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 Dockerfile diff --git a/.goreleaser.yml b/.goreleaser.yml index ab6d5b25..cbc75ddf 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -48,7 +48,24 @@ changelog: - "^docs:" - "^test:" archives: - - replacements: + - id: pgrokd + builds: + - pgrokd + name_template: "pgrokd_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + format_overrides: + - goos: windows + format: zip + - id: pgrok + builds: + - pgrok + name_template: "pgrok_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + replacements: darwin: Darwin linux: Linux windows: Windows @@ -59,6 +76,8 @@ archives: format: zip brews: - name: pgrok + ids: + - pgrok github: owner: jerson name: homebrew-tap @@ -70,3 +89,17 @@ brews: description: "Introspected tunnels to localhost a fork from pgrok." test: | system "#{bin}/pgrok -v" + - name: pgrokd + ids: + - pgrokd + github: + owner: jerson + name: homebrew-tap + commit_author: + name: Gerson Alexander Pardo Gamez + email: jeral17@gmail.com + folder: Formula + homepage: "https://github.com/jerson/pgrok" + description: "Introspected tunnels to localhost a fork from pgrok." + test: | + system "#{bin}/pgrokd -v" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..d2b90fc3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM jerson/go:1.13 AS builder + +ENV WORKDIR /app +WORKDIR ${WORKDIR} + +COPY . . +RUN make deps +RUN make build + +FROM jerson/base:1.2 + +LABEL maintainer="jeral17@gmail.com" + +ENV BUILDER_PATH /app +ENV WORKDIR /app +WORKDIR ${WORKDIR} + +COPY --from=builder ${BUILDER_PATH}/pgrok /usr/local/bin/pgrok +COPY --from=builder ${BUILDER_PATH}/pgrokd /usr/local/bin/pgrokd + +CMD ["pgrok"] \ No newline at end of file diff --git a/Makefile b/Makefile index 083f24fd..509e9833 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ +REGISTRY?=jerson/pgrok +APP_VERSION?=latest .PHONY: default server client deps fmt clean all release-all assets client-assets server-assets contributors -default: bin/go-bindata all +default: bin/go-bindata build deps: assets go get -d -v ./... @@ -33,7 +35,7 @@ server-assets: bin/go-bindata -o=server/assets/all.go \ assets/server/... -all: fmt client server +build: fmt client server clean: go clean -i -r ./... @@ -42,3 +44,14 @@ clean: contributors: echo "Contributors to pgrok, both large and small:\n" > CONTRIBUTORS git log --raw | grep "^Author: " | sort | uniq | cut -d ' ' -f2- | sed 's/^/- /' | cut -d '<' -f1 >> CONTRIBUTORS + +registry: registry-build registry-push + +registry-build: + docker build --pull -t $(REGISTRY):$(APP_VERSION) . + +registry-pull: + docker pull $(REGISTRY):$(APP_VERSION) + +registry-push: + docker push $(REGISTRY):$(APP_VERSION) diff --git a/README.md b/README.md index 3ad0ee47..43804863 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,22 @@ # pgrok - Introspected tunnels to localhost ### ”I want to expose a local server behind a NAT or firewall to the internet.” -# Install +# Install client Install supports **Linux** and **MacOS** with **homebrew** ```bash brew install jerson/tap/pgrok ``` +# Install server + +Install supports **Linux** and **MacOS** with **homebrew** +```bash +brew install jerson/tap/pgrokd +``` + +or you can just download it from download section + # Download just download in [Release section](https://github.com/jerson/pgrok/releases)