From 9a1371340b78e810ada17bc3faa0827cf722aa80 Mon Sep 17 00:00:00 2001 From: Hector Date: Sun, 20 Feb 2022 08:37:48 +0000 Subject: [PATCH 1/2] feat: rename output binary and archives Update the goreleaser config to rename the output binary and archive names to `fail2ban_exporter` instead of defaulting to the project name. This better aligns with conventions used by other exporters. Update the output archives to wrap the build files in a folder. This makes extracting the archives a little easier. --- .goreleaser.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 0113e8d..2675411 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,10 +1,12 @@ # This is an example goreleaser.yaml file with some sane defaults. # Make sure to check the documentation at http://goreleaser.com +project_name: fail2ban_exporter before: hooks: - make go/dependencies builds: - + binary: fail2ban_exporter dir: src goos: - linux @@ -20,6 +22,7 @@ builds: archives: - + wrap_in_directory: true files: - LICENSE - README.md From 8a531ea20aa9e2b2ae8f182a61c9784fd85a463d Mon Sep 17 00:00:00 2001 From: Hector Date: Sun, 20 Feb 2022 08:42:26 +0000 Subject: [PATCH 2/2] update binary names in docker image --- Dockerfile | 4 ++-- Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4742e37..c895e3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,6 @@ FROM debian:buster-slim WORKDIR /app # Copy compiled binary to release image -COPY --from=build /build/src/exporter /app/fail2ban-prometheus-exporter +COPY --from=build /build/src/fail2ban_exporter /app/fail2ban_exporter -ENTRYPOINT ["/app/fail2ban-prometheus-exporter"] +ENTRYPOINT ["/app/fail2ban_exporter"] diff --git a/Makefile b/Makefile index 456559e..4df76a9 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ build/release: ./tools/goreleaser_linux_amd64 --rm-dist --skip-publish build/docker: - cd src/ && go build -o exporter \ + cd src/ && go build -o fail2ban_exporter \ -ldflags '-X main.version=$(shell git describe --tags) -X main.commit=${shell git rev-parse HEAD} -X "main.date=${shell date --rfc-3339=seconds}" -X main.builtBy=docker' exporter.go docker/build/latest: