Verified Commit 3b60933c authored by Steve Azzopardi's avatar Steve Azzopardi
Browse files

Fix build on macOS and ldflags

macOS directory is not case senstative. It gets confused when there is a
file name VERSION and a directory called `version` and there are
conflicts which prevents macOS users from building the application.

Remove the `version` package since we don't really need packages for a 2
file application.

The version variables are not set properly inside of the Makefile since
it's using the wrong import path.
parent 49935b2e
......@@ -19,10 +19,10 @@ gitlabChangelog = .tmp/gitlab-changelog-$(GITLAB_CHANGELOG_VERSION)
PKG := $(shell go list .)
PKGs := $(shell go list ./... | grep -vE "^/vendor/")
GO_LDFLAGS := -X $(PKG).VERSION=$(VERSION) \
-X $(PKG).REVISION=$(REVISION) \
-X $(PKG).BRANCH=$(BRANCH) \
-X $(PKG).BUILT=$(BUILT) \
GO_LDFLAGS := -X main.VERSION=$(VERSION) \
-X main.REVISION=$(REVISION) \
-X main.BRANCH=$(BRANCH) \
-X main.BUILT=$(BUILT) \
-s -w
.PHONY: compile
......
......@@ -6,8 +6,6 @@ import (
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
"gitlab.com/gitlab-org/ci-cd/runner-tools/tlsctl/version"
)
func main() {
......@@ -15,10 +13,10 @@ func main() {
app.Name = "tlsctl"
app.Usage = "Set of commands to debug TLS certificates for GitLab Runner."
app.Description = "Set of commands to debug TLS certificates for GitLab Runner."
app.Version = version.Version().ShortLine()
app.Version = Version().ShortLine()
cli.VersionPrinter = func(_ *cli.Context) {
fmt.Print(version.Version().Extended())
fmt.Print(Version().Extended())
}
app.Commands = []cli.Command{
......
package version
package main
import (
"fmt"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment