Add distclean target create config and var dir on build

This commit is contained in:
Jan Eitzinger 2024-10-23 11:43:40 +02:00
parent 037b60954f
commit 2654a4e126
Signed by: moebiusband
GPG Key ID: 2574BA29B90D6DD5
2 changed files with 14 additions and 3 deletions

View File

@ -1,17 +1,24 @@
TARGET = ./cc-metric-store TARGET = ./cc-metric-store
VAR = ./var/checkpoints/
VERSION = 0.1.0 VERSION = 0.1.0
GIT_HASH := $(shell git rev-parse --short HEAD || echo 'development') GIT_HASH := $(shell git rev-parse --short HEAD || echo 'development')
CURRENT_TIME = $(shell date +"%Y-%m-%d:T%H:%M:%S") CURRENT_TIME = $(shell date +"%Y-%m-%d:T%H:%M:%S")
LD_FLAGS = '-s -X main.date=${CURRENT_TIME} -X main.version=${VERSION} -X main.commit=${GIT_HASH}' LD_FLAGS = '-s -X main.date=${CURRENT_TIME} -X main.version=${VERSION} -X main.commit=${GIT_HASH}'
.PHONY: clean test tags swagger $(TARGET) .PHONY: clean distclean test swagger $(TARGET)
.NOTPARALLEL: .NOTPARALLEL:
$(TARGET): $(TARGET): config.json $(VAR)
$(info ===> BUILD cc-metric-store) $(info ===> BUILD cc-metric-store)
@go build -ldflags=${LD_FLAGS} ./cmd/cc-metric-store @go build -ldflags=${LD_FLAGS} ./cmd/cc-metric-store
config.json:
@cp ./configs/config.json config.json
$(VAR):
@mkdir -p $(VAR)
swagger: swagger:
$(info ===> GENERATE swagger) $(info ===> GENERATE swagger)
@go run github.com/swaggo/swag/cmd/swag init -d ./internal/api,./internal/util -g api.go -o ./api @go run github.com/swaggo/swag/cmd/swag init -d ./internal/api,./internal/util -g api.go -o ./api
@ -22,6 +29,10 @@ clean:
@go clean @go clean
@rm -f $(TARGET) @rm -f $(TARGET)
distclean: clean
@rm -rf ./var
@rm -f config.json
test: test:
$(info ===> TESTING) $(info ===> TESTING)
@go clean -testcache @go clean -testcache

View File

@ -1,6 +1,6 @@
# `cc-metric-store` version 0.1.0 # `cc-metric-store` version 0.1.0
This is a bugfix release of `cc-backend`, the API backend and frontend This is a minor release of `cc-metric-store`, the metric timeseries cache
implementation of ClusterCockpit. implementation of ClusterCockpit.
For release specific notes visit the [ClusterCockpit Documentation](https://clusterockpit.org/docs/release/). For release specific notes visit the [ClusterCockpit Documentation](https://clusterockpit.org/docs/release/).