diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..0db76a0 --- /dev/null +++ b/.goreleaser.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index a42196d..106b352 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ -FROM quay.io/prometheus/busybox:latest -LABEL MAINTAINER="Audrius Karabanovas " +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" ] \ No newline at end of file +ENTRYPOINT [ "beat-exporter" ]