Skip to content

Commit

Permalink
inject proper version
Browse files Browse the repository at this point in the history
  • Loading branch information
kokizzu committed Feb 28, 2024
1 parent 03dbfa0 commit 5ede28f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ REGISTRY ?= ghcr.io
IMAGE_NAME ?= G-Core/external-dns-gcore-webhook
IMAGE_TAG ?= latest
IMAGE = $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_TAG)
VERSION = $(shell git describe --tag)

##@ General

Expand Down Expand Up @@ -61,8 +62,8 @@ clean: ## Clean the build directory

.PHONY: build
build: ## Build the binary
LOG_LEVEL=$(LOG_LEVEL) LOG_ENVIRONMENT=$(LOG_ENVIRONMENT) LOG_FORMAT=$(LOG_FORMAT) CGO_ENABLED=0 go build -mod \
vendor -o $(ARTIFACT_NAME) .
LOG_LEVEL=$(LOG_LEVEL) LOG_ENVIRONMENT=$(LOG_ENVIRONMENT) LOG_FORMAT=$(LOG_FORMAT) VERSION=$(VERSION) CGO_ENABLED=0 go build \
-mod vendor -ldflags "-X main.Version=${VERSION}" -o $(ARTIFACT_NAME) .

.PHONY: run
run:build ## Run the binary on local machine
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- --source=ingress
- --provider=webhook
- image: ghcr.io/g-core/external-dns-gcore-webhook:v0.0.4
- image: ghcr.io/g-core/external-dns-gcore-webhook:v0.0.7
name: gcore-webhook
ports:
- containerPort: 8888
Expand Down

0 comments on commit 5ede28f

Please sign in to comment.