Skip to content

Commit

Permalink
fix setting commit id and revision from makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jun 7, 2024
1 parent 4f25022 commit 63c327d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ ifeq ($(DEB_ARCH),386)
endif
DEBFILE ?= snclient-$(VERSION)-$(RPM_ARCH).deb

BUILD_FLAGS=-ldflags "-s -w -X pkg/snclient.Build=$(BUILD) -X pkg/snclient.Revision=$(REVISION)"
GITBASE=github.com/consol-monitoring/snclient
BUILD_FLAGS=-ldflags "-s -w -X $(GITBASE)/pkg/snclient.Build=$(BUILD) -X $(GITBASE)/pkg/snclient.Revision=$(REVISION)"
TEST_FLAGS=-timeout=5m $(BUILD_FLAGS)

NODE_EXPORTER_VERSION=1.8.1
Expand Down Expand Up @@ -602,7 +603,7 @@ release_blog_text: release_notes.txt
@echo ''
@echo '### Download'
@echo ''
@echo '<https://github.com/ConSol-Monitoring/snclient/releases/tag/v$(VERSION)>'
@echo '<https://$(GITBASE)/releases/tag/v$(VERSION)>'


# just skip unknown make targets
Expand Down
4 changes: 2 additions & 2 deletions pkg/snclient/snclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ const (

var (
// Build contains the current git commit id
// compile passing -ldflags "-X pkg/snclient.Build <build sha1>" to set the id.
// compile passing -ldflags "-X snclient.Build <build sha1>" to set the id.
Build = ""

// Revision contains the minor version number (number of commits, since last tag)
// compile passing -ldflags "-X pkg/snclient.Revision <commits>" to set the revision number.
// compile passing -ldflags "-X snclient.Revision <commits>" to set the revision number.
Revision = ""
)

Expand Down

0 comments on commit 63c327d

Please sign in to comment.