OP#176 initial commit

This commit is contained in:
2025-12-02 14:44:52 +01:00
parent 9643abc257
commit 93ca9e815e
10 changed files with 1448 additions and 91 deletions

28
makefile Normal file
View File

@@ -0,0 +1,28 @@
VERSION=1.1
ORGANIZATION=crunchydata
SOURCES:=$(shell find . -name '*.go' | grep -v './vendor')
TARGET:=postgresql-prometheus-adapter
.PHONY: all clean build docker-image docker-push test prepare-for-docker-build
all: $(TARGET)
build: $(TARGET)
$(TARGET): main.go $(SOURCES)
go build -ldflags="-X 'main.Version=${VERSION}'" -o $(TARGET)
container: $(TARGET) Dockerfile
@#podman rmi $(ORGANIZATION)/$(TARGET):latest $(ORGANIZATION)/$(TARGET):$(VERSION)
podman build -t $(ORGANIZATION)/$(TARGET):latest .
podman tag $(ORGANIZATION)/$(TARGET):latest $(ORGANIZATION)/$(TARGET):$(VERSION)
container-save: container
rm -f $(TARGET)-$(VERSION).tar
podman save --output=$(TARGET)-$(VERSION).tar $(ORGANIZATION)/$(TARGET):$(VERSION)
clean:
rm -f *~ $(TARGET)