File tree 4 files changed +11
-7
lines changed
4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change
1
+ versionFlag="github.com/dedis/d-voting.Version =$(shell git describe --tags) "
2
+ timeFlag="github.com/dedis/d-voting.BuildTime =$(shell date +'% d/% m/% y_% H:% M') "
3
+
1
4
lint :
2
5
# Coding style static check.
3
6
@go get -v honnef.co/go/tools/cmd/staticcheck
@@ -16,4 +19,7 @@ check: lint vet
16
19
go test ` go list ./... | grep -v /integration`
17
20
18
21
test_integration :
19
- go test ./integration
22
+ go test ./integration
23
+
24
+ build :
25
+ go build -ldflags=" -X $( versionFlag) -X $( timeFlag) " ./cli/memcoin
Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ serves those metrics with:
174
174
./memcoin --config /tmp/node1 metrics start --addr 127.0.0.1:9100 --path /metrics
175
175
```
176
176
177
- Build info can be added to the binary with the ` ldflags ` , at build time.. Infos
177
+ Build info can be added to the binary with the ` ldflags ` , at build time. Infos
178
178
are stored on variables in the root ` mod.go ` . For example:
179
179
180
180
``` sh
@@ -184,3 +184,4 @@ timeFlag="github.com/dedis/d-voting.BuildTime=`date +'%d/%m/%y_%H:%M'`"
184
184
go build -ldflags=" -X $versionFlag -X $timeFlag " ./cli/memcoin
185
185
```
186
186
187
+ Note that ` make build ` will do that for you.
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ type controller struct{}
19
19
func (m controller ) SetCommands (builder node.Builder ) {
20
20
21
21
cmd := builder .SetCommand ("metrics" )
22
- cmd .SetDescription ("interact with the DKG service " )
22
+ cmd .SetDescription ("register Prometheus metrics and servers them via HTTP " )
23
23
24
24
sub := cmd .SetSubCommand ("start" )
25
25
sub .SetDescription ("start an http server to server Prometheus metrics" )
Original file line number Diff line number Diff line change @@ -7,10 +7,7 @@ set -o errexit
7
7
8
8
command -v tmux > /dev/null 2>&1 || { echo >&2 " tmux is not on your PATH!" ; exit 1; }
9
9
10
- versionFlag=" github.com/dedis/d-voting.Version=` git describe --tags` "
11
- timeFlag=" github.com/dedis/d-voting.BuildTime=` date +' %d/%m/%y_%H:%M' ` "
12
-
13
- go build -ldflags=" -X $versionFlag -X $timeFlag " ./cli/memcoin
10
+ make build
14
11
15
12
# Launch session
16
13
s=" d-voting-test"
You can’t perform that action at this time.
0 commit comments