Commit Graph

23 Commits

Author SHA1 Message Date
555a7ce696
fix(makefile): use podman instead of docker 2023-07-09 12:59:32 +02:00
c7b68277d5
fix: rename application 2023-07-09 12:57:07 +02:00
2434615258
feat: multi-stage build for container image
Adapt the Makefile and Dockerfile for a multi-stage build of the
container image. It is now not anymore required to have go locally
installed to build the container image.

Inside the multi-stage build, the newly create make install command will
be executed. The compbiled files will than be copied to a new base image
with less dependencies.

Further improvement would be to use instead of debian:10 scratch,
because the application does not have any C dependencies
(CGO_ENABLED=0).

Additionally it is not possible to build the container image with
alternative container runtimes like podman instead of docker.

make build/container-image CONTAINER_RUNTIME=podman

The used base image names are now defined as fully qualified image names
(with registry host), to support local container registry mirror
configurations.
2023-07-07 14:42:42 +02:00
3639b7a3f4
fix(Makefile): add uninstall target 2023-07-07 13:33:21 +02:00
099694c636
fix(Makefile): add install target 2023-07-07 13:30:23 +02:00
003f740c2d
fix(Makefile): trim pkg path 2023-07-07 13:29:55 +02:00
Hector
b6cec83503 ci: add go vet to test stage (!99)
* Add `go vet` to the test stage of the Gitlab CI/CD pipeline
* Fix issues raised by `go vet`

https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/merge_requests/99
2023-06-22 18:24:15 +00:00
Hector
b9ab77d62d build: disable cgo for makefile build (!97)
* Disable `CGO` in the makefile build to avoid dependencies on external C libraries
* This also aligns with the build done for releases and docker images

https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/merge_requests/97
2023-06-22 15:22:42 +00:00
Hector
56ecc03341 chore: update makefile commands (!92)
* Tweak makefile commands and file formatting
* Remove command and build step for go mod formatting
* Add command to update project dependencies
* Add make command to list all make commands

https://gitlab.com/hectorjsmith/fail2ban-prometheus-exporter/-/merge_requests/92
2023-06-21 15:02:11 +00:00
Hector
772cdb52c5 chore: rewrite dockerfile
Rewrite the Dockerfile to be ready for fully automating releases using GoReleaser.
2023-06-19 19:06:18 +00:00
Hector
8ff64467db chore: rewrite make commands 2023-06-19 18:37:27 +00:00
Hector
ae1285dc66 chore: move source code to root folder 2023-06-19 17:58:16 +00:00
Hector
83be83d83d chore: remove hardcoded tools 2023-06-19 17:50:28 +00:00
Hector
3911eca07e 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 Dockerfile and Makefile to follow the new naming scheme.
Update the output archives to wrap the build files in a folder. This makes
extracting the archives a little easier.

BREAKING CHANGE: Release binary name has been changed to `fail2ban_exporter`.
2022-02-20 08:46:40 +00:00
Hector
05f236902a ci: update creation of tags (#19)
Update creation of docker tags to only tag actual releases with the
`:latest` tag. Builds on the main branch are now tagged with a `:nightly`
tag.
2022-02-12 17:31:01 +00:00
Hector
695447a4c2 refactor: update project makefile
Rename steps in the project makefile to follow a more consistent naming
scheme.
Add new gitlab CI step to check for unused dependencies.
2021-10-17 17:39:02 +00:00
Hector
742019a025 docs: update changelog
Update the project changelog.
Refactor the changelog structure to no longer be fully automated. It now
includes some manual tweaks.
Update the Makefile command to generate a new `CHANGELOG_gen.md` file
instead of overwriting the existing Changelog file.
2021-08-30 18:07:20 +01:00
Hector
b63f641bfd build: compile tool during docker build
Update the project Dockerfile to compile the tool during the docker build
instead of assuming the goreleaser tool was run previously. This allows
for custom data to be set in the compiled tool (e.g. compiled by docker)
and removes the dependency on another build step.
Update the Makefile to include a new command to build the tool for docker
which sets the version data correctly. Rename the docker commands to follow
the `docker/build-...` format to avoid confusion with the build commands.
2021-02-08 19:48:55 +00:00
Hector
9bf3195743 chore: move all source files to new folder
Update the project structure to move all golang files to a new `src/`
folder. This keeps all the code located in the same place and easier to
work with.
Update the Makefile and goreleaser config to continue to work with the new
folder structure.
2021-02-08 18:49:48 +00:00
Hector
9dc8dd862f build: add project dockerfile (#2)
Add a project Dockerfile to allow deploying the application in a docker
container. Add a `run.sh` script to start the application in the container.
Add Makefile commands to build the docker image based on the Dockerfile.
Fix possible nil reference error in the `db` package.
2021-02-07 13:09:02 +00:00
Hector
50e1d4b8c8 build: add tool to auto-generate changelog (#5)
Add the `git-chglog` tool to handle auto-generating the project changelog
based on the commit history. Add a custom configuration and file template.
Update the Makefile to include a command to generate the changelog.
2021-02-07 11:15:41 +00:00
Hector
570c162c13 build: add goreleaser to build tool (#6)
Add the `goreleaser` tool to the repository to handle building and
publishing the application. Add a simple configuration file to build the
application for all major OS versions.
Update the Makefile to include commands to build release and snapshot
versions of the tool.
Add a placeholder CHANGELOG file to be included in the package files.
2021-02-07 10:46:25 +00:00
Hector
5e52baa4cf initial commit 2021-02-05 22:49:47 +00:00