Skip to content

Commit e619a35

Browse files
committed
Add packages publishing
1 parent 72140ff commit e619a35

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed

Makefile

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export GO111MODULE := on
1717

1818
SRCS:=$(shell find . -name '*.go')
1919

20-
.PHONY: all clean docker test version
20+
.PHONY: all clean docker test version _nfpm
2121

2222
all: $(NAME)
2323
build: $(NAME)
@@ -84,16 +84,15 @@ artifact/%: out/% | artifact
8484
out/config.toml.example: $(NAME) | out
8585
./$(NAME) --print-defaults > $@
8686

87-
nfpm: nfpm-deb nfpm-rpm
88-
89-
nfpm-%: out/config.toml.example
90-
$(MAKE) out/done/$(NAME)-$(VERSION)-amd64-$* ARCH=amd64 PACKAGER=$*
91-
$(MAKE) out/done/$(NAME)-$(VERSION)-arm64-$* ARCH=arm64 PACKAGER=$*
92-
9387
.ONESHELL:
94-
out/done/$(NAME)-$(VERSION)%: nfpm.yaml | out/done gox-build
88+
nfpm:
89+
@$(MAKE) _nfpm ARCH=amd64 PACKAGER=deb
90+
@$(MAKE) _nfpm ARCH=arm64 PACKAGER=deb
91+
@$(MAKE) _nfpm ARCH=amd64 PACKAGER=rpm
92+
@$(MAKE) _nfpm ARCH=arm64 PACKAGER=rpm
93+
94+
_nfpm: nfpm.yaml out/config.toml.example | out/done gox-build
9595
@NAME=$(NAME) DESCRIPTION=$(DESCRIPTION) ARCH=$(ARCH) VERSION_STRING=$(VERSION) nfpm package --packager $(PACKAGER) --target out/
96-
@touch $@
9796

9897
packages: nfpm $(SUM_FILES)
9998

@@ -105,3 +104,32 @@ $(SUM_FILES): nfpm
105104
#######
106105
# END #
107106
#######
107+
108+
##############
109+
# PUBLISHING #
110+
##############
111+
112+
# Use `go install github.com/mlafeldt/pkgcloud/cmd/pkgcloud-push`
113+
114+
115+
.ONESHELL:
116+
packagecloud-push-rpm: $(wildcard out/$(NAME)-$(VERSION)*.rpm)
117+
for repo in el/{7..9}; do
118+
pkgcloud-push $(REPO)/$${repo} $^ || true
119+
done
120+
121+
.ONESHELL:
122+
packagecloud-push-deb: $(wildcard out/$(NAME)_$(VERSION)*.deb)
123+
for repo in ubuntu/{bionic,focal,jammy,nomble} debian/{buster,bullseye,bookworm}; do
124+
pkgcloud-push $(REPO)/$${repo} $^ || true
125+
done
126+
127+
packagecloud-push: nfpm
128+
@$(MAKE) packagecloud-push-rpm
129+
@$(MAKE) packagecloud-push-deb
130+
131+
packagecloud-autobuilds:
132+
$(MAKE) packagecloud-push REPO=go-graphite/autobuilds
133+
134+
packagecloud-stable:
135+
$(MAKE) packagecloud-push REPO=go-graphite/stable

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![deb](https://img.shields.io/badge/deb-packagecloud.io-844fec.svg)](https://packagecloud.io/go-graphite/stable)
2+
[![rpm](https://img.shields.io/badge/rpm-packagecloud.io-844fec.svg)](https://packagecloud.io/go-graphite/stable)
3+
14
# Service to optimize stale GraphiteMergeTree tables
25
When you use [GraphiteMergeTree](https://clickhouse.yandex/docs/en/operations/table_engines/graphitemergetree) in ClickHouse DBMS, it applies retention policies from `system.graphite_retentions` configuration during merge processes. Unfortunately, ClickHouse doesn't launch merges for partitions a) without active inserts or b) with only one part in. It means, that it never will watch for the actual retention scheme applied to partitions.
36
This software looking for tables with GraphiteMergeTree engine and evaluate if some of partitions should be optimized. It could work both as one-shot script and background daemon.

0 commit comments

Comments
 (0)