Skip to content

Commit dfbfda5

Browse files
authored
Goreleaser cleanup (#23)
Also upgrade dependencies and go 1.14
1 parent beac395 commit dfbfda5

File tree

6 files changed

+41
-42
lines changed

6 files changed

+41
-42
lines changed

.goreleaser.yml

+20-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
# .goreleaser.yml
22
before:
33
hooks:
4-
- make init
4+
- go mod download
55

66
builds:
7-
- main: .
8-
binary: emq_exporter
9-
goos:
10-
- linux
11-
goarch:
12-
- amd64
13-
env:
14-
- CGO_ENABLED=0
15-
- GO111MODULE=on
16-
flags:
17-
- -tags=netgo
18-
ldflags:
19-
- -s -w -X main.GitTag={{.Tag}} -X main.GitCommit={{.ShortCommit}}
7+
- id: main
8+
binary: emq_exporter
9+
goos:
10+
- linux
11+
goarch:
12+
- amd64
13+
env:
14+
- CGO_ENABLED=0
15+
- GO111MODULE=on
16+
ldflags:
17+
- -s -w -X main.GitTag={{.Tag}} -X main.GitCommit={{.ShortCommit}}
2018

2119
archives:
2220
- id: tar
@@ -25,11 +23,11 @@ archives:
2523
wrap_in_directory: true
2624

2725
dockers:
28-
- binaries:
29-
- emq_exporter
30-
goos: linux
31-
goarch: amd64
32-
dockerfile: Dockerfile
33-
image_templates:
34-
- "nuvo/{{ .ProjectName }}:latest"
35-
- "nuvo/{{ .ProjectName }}:{{ .Tag }}"
26+
- binaries:
27+
- emq_exporter
28+
goos: linux
29+
goarch: amd64
30+
dockerfile: Dockerfile
31+
image_templates:
32+
- "nuvo/{{ .ProjectName }}:latest"
33+
- "nuvo/{{ .ProjectName }}:{{ .Tag }}"

.travis.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
language: go
33

44
go:
5-
- 1.13.x
5+
- 1.14.x
66

77
services:
88
- docker
@@ -11,10 +11,8 @@ env:
1111
- GO111MODULE=on
1212

1313
install:
14-
- go get -v github.com/onsi/ginkgo/ginkgo
15-
- go get -v github.com/onsi/gomega
16-
- go get -v -t ./...
17-
- export PATH=$PATH:$HOME/gopath/bin
14+
- make init
15+
- export PATH=$PATH:$GOPATH/bin
1816

1917
script: make test
2018

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ FROM quay.io/prometheus/busybox:latest
33
COPY emq_exporter /bin/emq_exporter
44

55
EXPOSE 9505
6+
USER nobody
67

78
ENTRYPOINT [ "/bin/emq_exporter" ]

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ all: test build ## Run tests and build the binary
1010

1111
init:
1212
@echo ">> running go mod download"
13+
$(GO) get -v github.com/onsi/ginkgo/ginkgo
14+
$(GO) get -v github.com/onsi/gomega
1315
$(GO) get -v -t ./...
1416
$(GO) mod download
1517

16-
fmt: init ## Format code using go fmt
18+
fmt: ## Format code using go fmt
1719
@echo ">> formatting code"
1820
$(GO) fmt ./...
1921

20-
vet: init ## Vet code using go vet
22+
vet: ## Vet code using go vet
2123
@echo ">> vetting code"
2224
$(GO) vet ./...
2325

go.mod

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ module github.com/nuvo/emq_exporter
33
require (
44
code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48
55
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
6-
github.com/golang/protobuf v1.3.3 // indirect
6+
github.com/golang/protobuf v1.3.4 // indirect
77
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
88
github.com/onsi/ginkgo v1.12.0
99
github.com/onsi/gomega v1.9.0
10-
github.com/prometheus/client_golang v1.4.1
10+
github.com/prometheus/client_golang v1.5.0
1111
github.com/prometheus/common v0.9.1
1212
github.com/prometheus/procfs v0.0.10 // indirect
13-
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 // indirect
14-
golang.org/x/sys v0.0.0-20200217220822-9197077df867 // indirect
13+
golang.org/x/net v0.0.0-20200301022130-244492dfa37a // indirect
14+
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect
1515
golang.org/x/text v0.3.2 // indirect
1616
gopkg.in/alecthomas/kingpin.v2 v2.2.6
1717
gopkg.in/yaml.v2 v2.2.8 // indirect
1818
)
1919

20-
go 1.13
20+
go 1.14

go.sum

+8-8
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM
3131
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
3232
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
3333
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
34-
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
35-
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
34+
github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
35+
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
3636
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
3737
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
3838
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@@ -72,8 +72,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
7272
github.com/prometheus/client_golang v0.9.1 h1:K47Rk0v/fkEfwfQet2KWhscE0cJzjgCCDBG2KHZoVno=
7373
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
7474
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
75-
github.com/prometheus/client_golang v1.4.1 h1:FFSuS004yOQEtDdTq+TAOLP5xUq63KqAFYyOi8zA+Y8=
76-
github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
75+
github.com/prometheus/client_golang v1.5.0 h1:Ctq0iGpCmr3jeP77kbF2UxgvRwzWWz+4Bh9/vJTyg1A=
76+
github.com/prometheus/client_golang v1.5.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
7777
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
7878
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
7979
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
@@ -105,8 +105,8 @@ golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9
105105
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
106106
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
107107
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
108-
golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI=
109-
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
108+
golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
109+
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
110110
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
111111
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
112112
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
@@ -119,8 +119,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
119119
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
120120
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
121121
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
122-
golang.org/x/sys v0.0.0-20200217220822-9197077df867 h1:JoRuNIf+rpHl+VhScRQQvzbHed86tKkqwPMV34T8myw=
123-
golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
122+
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
123+
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
124124
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
125125
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
126126
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=

0 commit comments

Comments
 (0)