File tree Expand file tree Collapse file tree 3 files changed +50
-1
lines changed Expand file tree Collapse file tree 3 files changed +50
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Binaries for programs and plugins
2
+ * .exe
3
+ * .dll
4
+ * .so
5
+ * .dylib
6
+
7
+ # Test binary, build with `go test -c`
8
+ * .test
9
+
10
+ # Output of the go coverage tool, specifically when used with LiteIDE
11
+ * .out
12
+
13
+ # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
14
+ .glide /
15
+
16
+ dist
17
+ * .tar.gz
Original file line number Diff line number Diff line change
1
+ .SILENT :
2
+ .PHONY : tcping clean fmt
3
+
4
+ TAG: =` git describe --abbrev=0 --tags `
5
+ GITCOMMIT: =` git rev-parse HEAD `
6
+ LDFLAGS: =-X main.version=$(TAG ) -X main.gitCommit=$(GITCOMMIT )
7
+
8
+ all : tcping
9
+
10
+ tcping :
11
+ echo " Building tcping"
12
+ go install -ldflags " $( LDFLAGS) "
13
+
14
+ dist-clean :
15
+ rm -rf dist
16
+ rm -f tcping-* .tar.gz
17
+
18
+ dist : dist-clean
19
+ mkdir -p dist/alpine-linux/amd64 && GOOS=linux GOARCH=amd64 go build -ldflags " $( LDFLAGS) " -a -tags netgo -installsuffix netgo -o dist/alpine-linux/amd64/tcping
20
+ mkdir -p dist/linux/amd64 && GOOS=linux GOARCH=amd64 go build -ldflags " $( LDFLAGS) " -o dist/linux/amd64/tcping
21
+ mkdir -p dist/linux/armel && GOOS=linux GOARCH=arm GOARM=5 go build -ldflags " $( LDFLAGS) " -o dist/linux/armel/tcping
22
+ mkdir -p dist/linux/armhf && GOOS=linux GOARCH=arm GOARM=6 go build -ldflags " $( LDFLAGS) " -o dist/linux/armhf/tcping
23
+ mkdir -p dist/darwin/amd64 && GOOS=darwin GOARCH=amd64 go build -ldflags " $( LDFLAGS) " -o dist/darwin/amd64/tcping
24
+
25
+ release : dist
26
+ tar -cvzf tcping-alpine-linux-amd64-$(TAG ) .tar.gz -C dist/alpine-linux/amd64 tcping
27
+ tar -cvzf tcping-linux-amd64-$(TAG ) .tar.gz -C dist/linux/amd64 tcping
28
+ tar -cvzf tcping-linux-armel-$(TAG ) .tar.gz -C dist/linux/armel tcping
29
+ tar -cvzf tcping-linux-armhf-$(TAG ) .tar.gz -C dist/linux/armhf tcping
30
+ tar -cvzf tcping-darwin-amd64-$(TAG ) .tar.gz -C dist/darwin/amd64 tcping
Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ import (
15
15
16
16
var (
17
17
showVersion bool
18
- version = "dev"
18
+ version string
19
+ gitCommit string
19
20
counter int
20
21
timeout string
21
22
interval string
@@ -44,6 +45,7 @@ var rootCmd = cobra.Command{
44
45
Run : func (cmd * cobra.Command , args []string ) {
45
46
if showVersion {
46
47
fmt .Printf ("version: %s\n " , version )
48
+ fmt .Printf ("git: %s\n " , gitCommit )
47
49
return
48
50
}
49
51
if len (args ) != 2 && len (args ) != 1 {
You can’t perform that action at this time.
0 commit comments