Skip to content

Commit

Permalink
Merge pull request #1 from treydock/initial
Browse files Browse the repository at this point in the history
Initial
  • Loading branch information
treydock authored Apr 24, 2021
2 parents 0b0f3b9 + d7f015f commit a431d8e
Show file tree
Hide file tree
Showing 28 changed files with 3,918 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .circleci/config.yml
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: /.*/
21 changes: 21 additions & 0 deletions .editorconfig
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.tarballs
/.build
/infiniband_exporter
/c.out
/coverage.html
/coverage.txt
6 changes: 6 additions & 0 deletions .golangci.errcheck-exclude
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
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
linters-settings:
errcheck:
exclude: .golangci.errcheck-exclude
34 changes: 34 additions & 0 deletions .promu.yml
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## 0.0.1 / 2021-04-24

### Changes

* Initial Release

10 changes: 10 additions & 0 deletions Dockerfile
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"]
10 changes: 10 additions & 0 deletions Makefile
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 ./...
Loading

0 comments on commit a431d8e

Please sign in to comment.