-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from treydock/initial
Initial
- Loading branch information
Showing
28 changed files
with
3,918 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
version: 2.1 | ||
|
||
orbs: | ||
prometheus: prometheus/[email protected] | ||
codecov: codecov/[email protected] | ||
|
||
executors: | ||
# Whenever the Go version is updated here, .promu.yml should | ||
# also be updated. | ||
golang: | ||
docker: | ||
- image: circleci/golang:1.16 | ||
|
||
jobs: | ||
test: | ||
executor: golang | ||
steps: | ||
- prometheus/setup_environment | ||
- run: make | ||
- run: make coverage | ||
- codecov/upload: | ||
file: coverage.txt | ||
- prometheus/store_artifact: | ||
file: infiniband_exporter | ||
docker-build: | ||
executor: golang | ||
steps: | ||
- prometheus/setup_build_environment: | ||
docker_version: 19.03.8 | ||
- run: make -j3 docker | ||
workflows: | ||
version: 2 | ||
infiniband_exporter: | ||
jobs: | ||
- test: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- prometheus/build: | ||
name: build | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- docker-build: | ||
name: docker-build | ||
requires: | ||
- build | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- prometheus/publish_main: | ||
context: org-context | ||
docker_hub_organization: treydock | ||
quay_io_organization: treydock | ||
requires: | ||
- test | ||
- build | ||
filters: | ||
branches: | ||
only: main | ||
- prometheus/publish_release: | ||
context: org-context | ||
docker_hub_organization: treydock | ||
quay_io_organization: treydock | ||
requires: | ||
- test | ||
- build | ||
filters: | ||
tags: | ||
only: /^v([0-9]).*/ | ||
branches: | ||
ignore: /.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
[*.go] | ||
indent_size = 4 | ||
indent_style = tab | ||
|
||
# Tab indentation (no size specified) | ||
[Makefile] | ||
indent_style = tab | ||
|
||
[{*.md,*.yaml,*.yml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/.tarballs | ||
/.build | ||
/infiniband_exporter | ||
/c.out | ||
/coverage.html | ||
/coverage.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Used in HTTP handlers, any error is handled by the server itself. | ||
(net/http.ResponseWriter).Write | ||
// Never check for logger errors. | ||
(github.com/go-kit/kit/log.Logger).Log | ||
// Do not check for rename errors | ||
os.Rename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
linters-settings: | ||
errcheck: | ||
exclude: .golangci.errcheck-exclude |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
go: | ||
version: 1.16 | ||
cgo: false | ||
repository: | ||
path: github.com/treydock/infiniband_exporter | ||
build: | ||
binaries: | ||
- name: infiniband_exporter | ||
path: . | ||
flags: -a -tags netgo | ||
ldflags: | | ||
-extldflags "-static" | ||
-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 | ||
- CHANGELOG.md | ||
crossbuild: | ||
platforms: | ||
- linux/amd64 | ||
- linux/386 | ||
- linux/arm | ||
- linux/arm64 | ||
- linux/mips | ||
- linux/mipsle | ||
- linux/mips64 | ||
- linux/mips64le | ||
- linux/ppc64 | ||
- linux/ppc64le | ||
- linux/s390x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## 0.0.1 / 2021-04-24 | ||
|
||
### Changes | ||
|
||
* Initial Release | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
FROM ${ARCH}/debian:10 | ||
LABEL maintainer="Trey Dockendorf <[email protected]>" | ||
ARG ARCH="amd64" | ||
ARG OS="linux" | ||
COPY .build/${OS}-${ARCH}/infiniband_exporter /infiniband_exporter | ||
RUN apt update && apt install -y infiniband-diags && apt clean && rm -rf /var/lib/{apt,dpkg,cache,log}/ | ||
EXPOSE 9315 | ||
ENTRYPOINT ["/infiniband_exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Needs to be defined before including Makefile.common to auto-generate targets | ||
DOCKER_ARCHS ?= amd64 ppc64le s390x | ||
DOCKER_REPO ?= treydock | ||
|
||
include Makefile.common | ||
|
||
DOCKER_IMAGE_NAME ?= infiniband_exporter | ||
|
||
coverage: | ||
go test -race -coverprofile=coverage.txt -covermode=atomic ./... |
Oops, something went wrong.