update command names in makefile

Rename several commands in the project makefile to follow a more consistent
naming scheme.
Update all references to changed commands.
This commit is contained in:
Hector 2021-10-17 18:14:57 +01:00
parent 5363cad4ce
commit bd7f370379
3 changed files with 20 additions and 18 deletions

View File

@ -1,7 +1,7 @@
image: golang:latest image: golang:latest
before_script: before_script:
- make install-deps - make go/dependencies
stages: stages:
- test - test
@ -10,12 +10,12 @@ stages:
format: format:
stage: test stage: test
script: script:
- make format - make go/checkFmt
test: test:
stage: test stage: test
script: script:
- make test - make go/test
build: build:
stage: build stage: build
@ -44,6 +44,6 @@ docker-gitlab:
- apk add make - apk add make
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script: script:
- make docker/build-latest - make docker/buildLatest
- make docker/build-tag - make docker/buildTag
- docker push registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter - docker push registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter

View File

@ -2,7 +2,7 @@
# Make sure to check the documentation at http://goreleaser.com # Make sure to check the documentation at http://goreleaser.com
before: before:
hooks: hooks:
- make install-deps - make go/dependencies
builds: builds:
- -
dir: src dir: src

View File

@ -1,20 +1,22 @@
install-deps: go/dependencies:
cd src/ && go mod download cd src/ && go mod download
# Standard go test
test:
cd src/ && go test ./... -v -race
# Make sure no unnecessary dependencies are present # Make sure no unnecessary dependencies are present
go-mod-tidy: go/checkDependencies:
cd src/ && go mod tidy -v cd src/ && go mod tidy -v
git diff-index --quiet HEAD git diff-index --quiet HEAD
format: # Standard go test
cd src/ && go fmt $(go list ./... | grep -v /vendor/) go/test:
cd src/ && go vet $(go list ./... | grep -v /vendor/) cd src/ && go test ./... -v -race
generateChangelog: go/fmt:
cd src/ && go fmt ./...
go/checkFmt:
test -z $(shell gofmt -l .)
docs/genChangelog:
./tools/git-chglog_linux_amd64 --config tools/chglog/config.yml 0.0.0.. > CHANGELOG_gen.md ./tools/git-chglog_linux_amd64 --config tools/chglog/config.yml 0.0.0.. > CHANGELOG_gen.md
build/snapshot: build/snapshot:
@ -27,8 +29,8 @@ build/docker:
cd src/ && go build -o exporter \ cd src/ && go build -o 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 -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: docker/buildLatest:
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest . docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest .
docker/build-tag: docker/buildTag:
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:$(shell git describe --tags) . docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:$(shell git describe --tags) .