Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use goreleaser and enable arm64 #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
project_name: beat-exporter

builds:
- id: beat-exporter
binary: beat-exporter
main: ./main.go
flags:
- -tags="netgo static_build"
env:
- CGO_ENABLED=0
ldflags:
- -s -w
- -X github.com/prometheus/common/version.Revision={{ .FullCommit }}
- -X github.com/prometheus/common/version.Version={{ .Version }}
- -X github.com/prometheus/common/version.Branch={{ .Tag }}
- -X github.com/prometheus/common/version.BuildDate={{ .Date }}
- -X github.com/prometheus/common/version.BuildUser=goreleaser
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64

archives:
- id: tarball
builds:
- beat-exporter
format_overrides:
- goos: windows
format: zip
files:
- none*

dockers:
- ids:
- beat-exporter
goos: linux
goarch: amd64
image_templates:
- trustpilot/beat-exporter:latest
- trustpilot/beat-exporter:{{ .Tag }}
- trustpilot/beat-exporter:{{ .Major }}.{{ .Minor }}
- trustpilot/beat-exporter:{{ .Major }}
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{ .Date }}"
- "--label=org.opencontainers.image.title={{ .ProjectName }}"
- "--label=org.opencontainers.image.revision={{ .FullCommit }}"
- "--label=org.opencontainers.image.version={{ .Version }}"

checksum:
ids:
- beat-exporter

release:
github:
owner: trustpilot
name: beat-exporter
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM quay.io/prometheus/busybox:latest
LABEL MAINTAINER="Audrius Karabanovas <[email protected]>"
FROM quay.io/prometheus/busybox:uclibc

COPY .build/linux-amd64/beat-exporter /bin/beat-exporter
COPY beat-exporter /usr/local/bin/beat-exporter

EXPOSE 9479
ENTRYPOINT [ "/bin/beat-exporter" ]
ENTRYPOINT [ "beat-exporter" ]