Skip to content

Commit

Permalink
feat: Add version flags to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyb3r-Jak3 committed Aug 4, 2024
1 parent 180a5c1 commit 86f9054
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 0 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

builds:
- env:
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
GIT_VERSION ?= $(shell git describe --tags --always --dirty="-dev")
DATE ?= $(shell date -u '+%Y-%m-%d %H:%M UTC')
VERSION_FLAGS := -s -w -X "main.version=$(GIT_VERSION)" -X "main.date=$(DATE)"
CGO_ENABLED ?= 0
.PHONY: build
build:
CGO_ENABLED=0 go build --ldflags '-w -s -extldflags "-static"' -o cloudflare_exporter .
go build -trimpath --ldflags '$(VERSION_FLAGS) -extldflags "-static"' -o cloudflare_exporter .
lint:
golangci-lint run
clean:
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,22 @@ Note: `ZONE_<name>` configuration is not supported as flag.
# HELP cloudflare_r2_storage_bytes Storage used by R2
```

## Helm chart repository
To deploy the exporter into Kubernetes, we recommend using our manager Helm repository:
[//]: # (## Helm chart repository)

```
helm repo add cloudflare-exporter https://lablabs.github.io/cloudflare-exporter/
helm install cloudflare-exporter/cloudflare-exporter
```
[//]: # (To deploy the exporter into Kubernetes, we recommend using our manager Helm repository:)

[//]: # ()
[//]: # (```)

[//]: # (helm repo add cloudflare-exporter https://lablabs.github.io/cloudflare-exporter/)

[//]: # (helm install cloudflare-exporter/cloudflare-exporter)

[//]: # (```)

## Docker
### Build
Images are available at [Github Container Registry](https://github.com/lablabs/cloudflare-exporter/pkgs/container/cloudflare_exporter)
Images are available at [Github Container Registry](https://github.com/Cyb3r-Jak3/cloudflare-exporter/pkgs/container/cloudflare_exporter)

```
docker build -t ghcr.io/Cyb3r-Jak3/cloudflare_exporter .
Expand Down Expand Up @@ -149,7 +154,7 @@ docker run --rm -p 8080:8080 -e CF_API_TOKEN=${CF_API_TOKEN} -e FREE_TIER=true g

Access help:
```
docker run --rm -p 8080:8080 -i ghcr.io/lablabs/cloudflare_exporter --help
docker run --rm -p 8080:8080 -i ghcr.io/Cyb3r-Jak3/cloudflare_exporter --help
```

## Contributing and reporting issues
Expand Down

0 comments on commit 86f9054

Please sign in to comment.