File tree Expand file tree Collapse file tree 7 files changed +658
-4
lines changed
Expand file tree Collapse file tree 7 files changed +658
-4
lines changed Original file line number Diff line number Diff line change @@ -29,3 +29,9 @@ $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
2929 @echo " (re)installing $( GOBIN) /golangci-lint-v1.62.2"
3030 @cd $(BINGO_DIR ) && GOWORK=off $(GO ) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN ) /golangci-lint-v1.62.2 " github.com/golangci/golangci-lint/cmd/golangci-lint"
3131
32+ PROMTOOL := $(GOBIN ) /promtool-v0.306.0
33+ $(PROMTOOL ) : $(BINGO_DIR ) /promtool.mod
34+ @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
35+ @echo " (re)installing $( GOBIN) /promtool-v0.306.0"
36+ @cd $(BINGO_DIR ) && GOWORK=off $(GO ) build -mod=mod -modfile=promtool.mod -o=$(GOBIN ) /promtool-v0.306.0 " github.com/prometheus/prometheus/cmd/promtool"
37+
Original file line number Diff line number Diff line change 1+ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
2+
3+ go 1.23.0
4+
5+ toolchain go1.23.4
6+
7+ replace github.com/fsnotify/fsnotify v1.8.0 => github.com/fsnotify/fsnotify v1.7.0
8+
9+ exclude github.com/linode/linodego v1.0.0
10+
11+ exclude github.com/grpc-ecosystem/grpc-gateway v1.14.7
12+
13+ exclude google.golang.org/api v0.30.0
14+
15+ require github.com/prometheus/prometheus v0.306.0 // cmd/promtool
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -12,3 +12,5 @@ BINGO="${GOBIN}/bingo-v0.9.0"
1212
1313GOLANGCI_LINT = " ${ GOBIN } /golangci-lint-v1.62.2"
1414
15+ PROMTOOL = " ${ GOBIN } /promtool-v0.306.0"
16+
Original file line number Diff line number Diff line change 1515 uses : golangci/golangci-lint-action@v4
1616 with :
1717 version : v1.62.2
18+ - name : promtool
19+ run : make lint-promtool
Original file line number Diff line number Diff line change @@ -17,13 +17,20 @@ test:
1717 $(GO_CMD ) test -cover ./...
1818
1919.PHONY : lint
20- lint : $(GOLANGCI_LINT )
20+ lint : lint-go lint-promtool
21+
22+ .PHONY : lint-go
23+ lint-go : $(GOLANGCI_LINT )
2124 $(GOLANGCI_LINT ) run
2225
23- .PHONY : lint-fix
24- lint-fix : $(GOLANGCI_LINT )
26+ .PHONY : lint-go- fix
27+ lint-go- fix : $(GOLANGCI_LINT )
2528 $(GOLANGCI_LINT ) run --fix
2629
30+ .PHONY : lint-promtool
31+ lint-promtool : $(PROMTOOL ) contrib/prometheus-alerts.yaml
32+ $(PROMTOOL ) check rules contrib/prometheus-alerts.yaml
33+
2734.PHONY : build-binary
2835build-binary :
2936 $(GO_CMD ) build -tags netgo -ldflags " -w -X main.Version=$( VERSION) -X main.GitCommit=$( GIT_COMMIT) " -o nextcloud-exporter .
@@ -49,7 +56,7 @@ all-images:
4956 docker buildx build -t " ghcr.io/$( DOCKER_REPO) :$( DOCKER_TAG) " -t " docker.io/$( DOCKER_REPO) :$( DOCKER_TAG) " --platform linux/amd64,linux/arm64 --push .
5057
5158.PHONY : tools
52- tools : $(BINGO ) $(GOLANGCI_LINT )
59+ tools : $(BINGO ) $(GOLANGCI_LINT ) $( PROMTOOL )
5360 @echo Tools built.
5461
5562.PHONY : clean
Original file line number Diff line number Diff line change 1+ groups :
2+ - name : nextcloud
3+ rules :
4+ - alert : NextcloudUpdateWarning
5+ expr : |
6+ sum by (instance, version, available_version) (nextcloud_system_update_available) > 0
7+ for : 15m
8+ annotations :
9+ summary : |
10+ Version {{ index $labels "available_version" }} available for Nextcloud server {{ index $labels "instance" }}.
11+ description : |
12+ The Nextcloud server at {{ index $labels "instance" }} can be updated to version {{ index $labels "available_version" }} (from {{ index $labels "version" }}).
13+ labels :
14+ severity : warning
You can’t perform that action at this time.
0 commit comments