Skip to content

Commit

Permalink
Remove 'v' from app version (#922)
Browse files Browse the repository at this point in the history
Closes #909.
  • Loading branch information
roman-khimov authored Feb 6, 2024
2 parents 6198656 + 2cfa5a3 commit 8bdfbc9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Common variables
REPO ?= $(shell go list -m)
VERSION ?= $(shell git describe --tags --dirty --match "v*" --always --abbrev=8 2>/dev/null || cat VERSION 2>/dev/null || echo "develop")
VERSION ?= $(shell git describe --tags --dirty --match "v*" --always --abbrev=8 | sed 's/^v//' 2>/dev/null || cat VERSION 2>/dev/null || echo "develop")
GO_VERSION ?= 1.21
LINT_VERSION ?= 1.49.0
BINDIR = bin
Expand All @@ -14,7 +14,6 @@ BINS = $(addprefix $(BINDIR)/, $(CMDS))
# Variables for docker
REPO_BASENAME = $(shell basename `go list -m`)
HUB_IMAGE ?= "nspccdev/$(REPO_BASENAME)"
HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"

.PHONY: all $(BINS) $(BINDIR) dep docker/ test cover format image image-push dirty-image lint docker/lint version clean protoc

Expand Down Expand Up @@ -86,12 +85,12 @@ image:
--build-arg VERSION=$(VERSION) \
--rm \
-f .docker/Dockerfile \
-t $(HUB_IMAGE):$(HUB_TAG) .
-t $(HUB_IMAGE):$(VERSION) .

# Push Docker image to the hub
image-push:
@echo "⇒ Publish image"
@docker push $(HUB_IMAGE):$(HUB_TAG)
@docker push $(HUB_IMAGE):$(VERSION)

# Build dirty Docker image
dirty-image:
Expand All @@ -101,7 +100,7 @@ dirty-image:
--build-arg VERSION=$(VERSION) \
--rm \
-f .docker/Dockerfile.dirty \
-t $(HUB_IMAGE)-dirty:$(HUB_TAG) .
-t $(HUB_IMAGE)-dirty:$(VERSION) .

# Run linters
lint:
Expand Down

0 comments on commit 8bdfbc9

Please sign in to comment.