Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit bae50e7

Browse files
author
Audrius Karabanovas
committed
Initial
0 parents  commit bae50e7

19 files changed

+1781
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
vendor
2+
.build
3+
.tarballs
4+
beat-exporter

.promu.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
verbose: true
2+
repository:
3+
path: github.com/trustpilot/beat-exporter
4+
build:
5+
flags: -a -tags 'netgo static_build'
6+
ldflags: |
7+
-s
8+
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}}
9+
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}}
10+
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}}
11+
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
12+
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
13+
tarball:
14+
files:
15+
- LICENSE
16+
crossbuild:
17+
platforms:
18+
- linux/amd64
19+
- linux/386
20+
- darwin/amd64
21+
- darwin/386
22+
- windows/amd64
23+
- windows/386

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
dist: trusty
2+
sudo: required
3+
language: go
4+
5+
go:
6+
- 1.10.x
7+
8+
go_import_path: github.com/trustpilot/beat-exporter
9+
10+
services:
11+
- docker
12+
13+
before_script:
14+
- make dependencies
15+
16+
script:
17+
- make travis
18+
19+
branches:
20+
only: master

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM quay.io/prometheus/golang-builder as builder
2+
3+
ADD . /go/src/github.com/trustpilot/beat-exporter
4+
WORKDIR /go/src/github.com/trustpilot/beat-exporter
5+
6+
RUN make
7+
8+
FROM quay.io/prometheus/busybox:latest
9+
MAINTAINER Audrius Karabanovas <[email protected]>
10+
11+
COPY --from=builder /go/src/github.com/trustpilot/beat-exporter/beat-exporter /bin/beat-exporter
12+
13+
EXPOSE 9479
14+
ENTRYPOINT [ "/bin/beat-exporter" ]

Gopkg.lock

Lines changed: 110 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[[constraint]]
2+
name = "github.com/prometheus/client_golang"
3+
version = "0.8.0"
4+
5+
[[constraint]]
6+
branch = "master"
7+
name = "github.com/prometheus/common"
8+
9+
[[constraint]]
10+
name = "github.com/sirupsen/logrus"
11+
version = "1.0.6"

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Trustpilot
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Copyright 2016 The Prometheus Authors
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
GO := GO15VENDOREXPERIMENT=1 go
15+
PROMU := $(GOPATH)/bin/promu
16+
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
17+
18+
PREFIX ?= $(shell pwd)
19+
BIN_DIR ?= $(shell pwd)
20+
DOCKER_IMAGE_NAME ?= beat-exporter
21+
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))
22+
23+
24+
all: format dependencies build test
25+
26+
style:
27+
@echo ">> checking code style"
28+
@! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
29+
30+
test:
31+
@echo ">> running tests"
32+
@$(GO) test -short $(pkgs)
33+
34+
format:
35+
@echo ">> formatting code"
36+
@$(GO) fmt $(pkgs)
37+
38+
vet:
39+
@echo ">> vetting code"
40+
@$(GO) vet $(pkgs)
41+
42+
dependencies:
43+
@echo ">> installing dep"
44+
@$(GO) get -u github.com/golang/dep/cmd/dep
45+
@echo ">> running dep ensure"
46+
@dep ensure
47+
48+
build: promu
49+
@echo ">> building binaries"
50+
@$(PROMU) build --prefix $(PREFIX)
51+
52+
crossbuild: promu
53+
@echo ">> cross-building binaries"
54+
@$(PROMU) crossbuild
55+
56+
tarball: promu
57+
@echo ">> building release tarball"
58+
@$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
59+
60+
tarballs: promu
61+
@echo ">> building release tarballs"
62+
@$(PROMU) crossbuild tarballs $(BIN_DIR)
63+
64+
travis: dependencies format build
65+
@$(PROMU) info
66+
67+
docker:
68+
@echo ">> building docker image"
69+
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .
70+
71+
promu:
72+
@echo ">> installing promu"
73+
@GOOS=$(shell uname -s | tr A-Z a-z) \
74+
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
75+
$(GO) get -u github.com/prometheus/promu
76+
77+
.PHONY: all style format build test vet tarball docker promu travis dependencies

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

0 commit comments

Comments
 (0)