Skip to content

Commit

Permalink
Merge pull request #17 from adhocteam/nrh/bump-go-1.13.1
Browse files Browse the repository at this point in the history
bump to go 1.13.1 tidy up the dockerfile
  • Loading branch information
nathanhruby authored Oct 11, 2019
2 parents 6736f01 + 0fd14d0 commit 9b9b0bf
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 163 deletions.
13 changes: 7 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ version: 2

jobs:
test:
-image: circleci/golang:1.13
steps:
- checkout
- run: make test
docker:
- image: circleci/golang:1.13
steps:
- checkout
- run: make test

workflows:
version: 2
build:
doit:
jobs:
- build
- test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.build
script_exporter
*.tar.gz
13 changes: 6 additions & 7 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
go:
version: 1.12.6
version: 1.13.1
cgo: true
repository:
path: github.com/adhocteam/script_exporter
build:
flags: -a -tags 'netgo static_build'
ldflags: |
-linkmode external -extldflags -static
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}}
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}}
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}}
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
-X github.com/prometheus/common/version.Branch={{.Branch}}
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
tarball:
files:
- LICENSE
Expand Down
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
FROM golang:1.12.6-alpine AS build-env
MAINTAINER James Kassemi (Ad Hoc, LLC) <[email protected]>
FROM golang:1.13.1-alpine AS build-env

RUN apk add --update git
RUN apk add --update gcc
RUN apk add --update libc-dev
RUN apk add --update git gcc libc-dev
RUN go get -u github.com/prometheus/promu

RUN mkdir script_exporter
COPY .promu.yml /go/script_exporter/
COPY script_exporter.go /go/script_exporter/
COPY go.mod /go/script_exporter/
COPY go.sum /go/script_exporter/
COPY .promu.yml script_exporter.go go.mod go.sum /go/script_exporter/

WORKDIR /go/script_exporter
RUN promu build

FROM alpine:3.8
COPY --from=build-env /go/script_exporter/script_exporter /bin/
LABEL upstream="https://github.com/adhocteam/script_exporter"
LABEL maintainer="[email protected]"
COPY --from=build-env /go/script_exporter/script_exporter /bin/script-exporter
COPY script-exporter.yml /etc/script-exporter/config.yml

EXPOSE 9172
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

GO := GO111MODULE=on go
PROMU := $(GOPATH)/bin/promu
GO := GO111MODULE=on go
GOPATH := $(shell go env GOPATH)
PROMU := $(GOPATH)/bin/promu

PREFIX ?= $(shell pwd)
BIN_DIR ?= $(shell pwd)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Prometheus exporter written to execute and collect metrics on script exit status
and duration. Designed to allow the execution of probes where support for the
probe type wasn't easily configured with the Prometheus blackbox exporter.

Minimum supported Go Version: 1.7.3
Minimum supported Go Version: 1.13.1

## Sample Configuration

Expand All @@ -29,7 +29,7 @@ You can run via docker with:
```
docker run -d -p 9172:9172 --name script-exporter \
-v `pwd`/config.yml:/etc/script-exporter/config.yml:ro \
-v `pwd`/script-exporter.yml:/etc/script-exporter/config.yml:ro \
adhocteam/script-exporter:master \
-config.file=/etc/script-exporter/config.yml \
-web.listen-address=":9172" \
Expand Down
39 changes: 12 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,34 +1,19 @@
module github.com/adhocteam/script_exporter

go 1.12
go 1.13

require (
cloud.google.com/go v0.40.0 // indirect
github.com/golang/mock v1.3.1 // indirect
github.com/google/btree v1.0.0 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/google/go-github/v25 v25.1.3 // indirect
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/kr/pty v1.1.5 // indirect
github.com/prometheus/client_golang v1.0.0
github.com/prometheus/common v0.6.0
github.com/prometheus/promu v0.4.0 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/stretchr/objx v0.2.0 // indirect
go.opencensus.io v0.22.0 // indirect
golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443 // indirect
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522 // indirect
golang.org/x/image v0.0.0-20190618124811-92942e4437e2 // indirect
golang.org/x/mobile v0.0.0-20190607214518-6fa95d984e88 // indirect
golang.org/x/mod v0.1.0 // indirect
golang.org/x/net v0.0.0-20190620200207-3b0461eec859 // indirect
golang.org/x/sys v0.0.0-20190621134130-06bbe82148b1 // indirect
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
golang.org/x/tools v0.0.0-20190620191750-1fa568393b23 // indirect
google.golang.org/appengine v1.6.1 // indirect
google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601 // indirect
google.golang.org/grpc v1.21.1 // indirect
gopkg.in/yaml.v2 v2.2.2
honnef.co/go/tools v0.0.0-20190614002413-cb51c254f01b // indirect
github.com/prometheus/client_golang v1.1.0
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 // indirect
github.com/prometheus/common v0.7.0
github.com/prometheus/procfs v0.0.5 // indirect
github.com/prometheus/promu v0.5.0 // indirect
golang.org/x/net v0.0.0-20191009170851-d66e71096ffb // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sys v0.0.0-20191010194322-b09406accb47 // indirect
google.golang.org/appengine v1.6.5 // indirect
gopkg.in/yaml.v2 v2.2.4
)
Loading

0 comments on commit 9b9b0bf

Please sign in to comment.