diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7b1c3e8..4d70548 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -154,7 +154,7 @@ jobs: GOARCH: ${{ matrix.arch }} CGO_ENABLED: 1 run: | - go build -o ./build/probe-${{ matrix.os }}-${{ matrix.arch }} ./cmd + go build -o ./build/probe-${{ matrix.os }}-${{ matrix.arch }} ./cmd/probe - name: list result run: ls -la ./build - name: Upload Artifact @@ -212,7 +212,7 @@ jobs: cd /src mkdir assets git config --global --add safe.directory /src - /crossbuild -p ${{matrix.os}}/${{matrix.arch}} --build-cmd "go build -o ./assets/probe-${{matrix.os}}-${{matrix.arch}} ./cmd" + /crossbuild -p ${{matrix.os}}/${{matrix.arch}} --build-cmd "go build -o ./assets/probe-${{matrix.os}}-${{matrix.arch}} ./cmd/probe" ls -l ./assets - name: list result run: ls -la ./assets/probe-${{matrix.os}}-${{matrix.arch}} diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 28b879a..56dda8d 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -54,7 +54,7 @@ jobs: GOARCH: ${{ matrix.arch }} CGO_ENABLED: 1 run: | - go build -o build/probe-${{ matrix.os }}-${{ matrix.arch }} ./cmd + go build -o build/probe-${{ matrix.os }}-${{ matrix.arch }} ./cmd/probe - name: list result run: ls -la build @@ -96,7 +96,7 @@ jobs: cd /src mkdir assets git config --global --add safe.directory /src - /crossbuild -p ${{matrix.os}}/${{matrix.arch}} --build-cmd "go build -o ./assets/probe-${{matrix.os}}-${{matrix.arch}} ./cmd" + /crossbuild -p ${{matrix.os}}/${{matrix.arch}} --build-cmd "go build -o ./assets/probe-${{matrix.os}}-${{matrix.arch}} ./cmd/probe" ls -l ./assets - name: list result run: | diff --git a/Makefile b/Makefile index 3de884d..4155f76 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ .PHONY: default -default: lint test +default: probe test .PHONY: test -test: - nice go build -o probe ./cmd +test: probe ./probe probe google.com:443 .PHONY: all @@ -11,13 +10,13 @@ all: probe probe-linux-amd64 probe-linux-arm64 sources = $(shell find . -name '*.go') probe: $(sources) - go build -o $@ ./cmd + go build -o $@ ./cmd/probe probe-linux-amd64: - GOARCH=amd64 GOOS=linux go build -o $@ ./cmd + GOARCH=amd64 GOOS=linux go build -o $@ ./cmd/probe probe-linux-arm64: - GOARCH=arm64 GOOS=linux go build -o $@ ./cmd + GOARCH=arm64 GOOS=linux go build -o $@ ./cmd/probe .PHONY: lint lint: diff --git a/README.md b/README.md index 621e655..374c945 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,26 @@ I prefered `drill` (similar to `dig`) to check DNS resolving, `telnet` to check To smoothen the process, I wrote `thz/probe` to do all these checks in one go and provide exactly the relevant details for every step. +## Install / Get it + +Download the latest binary from the GitHub release page: https://github.com/thz/probe/releases/latest + +Alternatively, you can: +``` +# build it yourself (without cloning) +GOBIN=$(pwd) go install github.com/thz/probe/cmd/probe@latest +./probe google.com:443 + +# build it yourself +git clone https://github.com/thz/probe +cd probe +make probe test + +# use docker +docker pull thzpub/probe # optional +docker run --rm -ti thzpub/probe google.com:443 +``` + ## Probe Usage ``` diff --git a/cmd/capturer.go b/cmd/probe/capturer.go similarity index 100% rename from cmd/capturer.go rename to cmd/probe/capturer.go diff --git a/cmd/main.go b/cmd/probe/main.go similarity index 100% rename from cmd/main.go rename to cmd/probe/main.go diff --git a/cmd/probe.go b/cmd/probe/probe.go similarity index 100% rename from cmd/probe.go rename to cmd/probe/probe.go