From d96dfbe85229ef7c8e0f6c02fd4c7642f6836798 Mon Sep 17 00:00:00 2001 From: Alireza Mosajjal Date: Sat, 29 May 2021 21:12:41 +1200 Subject: [PATCH] releaseVersion tag attempt 2 --- Dockerfile-release | 4 ++-- src/main.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile-release b/Dockerfile-release index d3a11eb..38cc0e2 100644 --- a/Dockerfile-release +++ b/Dockerfile-release @@ -5,8 +5,8 @@ RUN apk add --no-cache libcap-static libpcap-dev linux-headers git go file --rep RUN git clone https://github.com/mosajjal/dnsmonster.git /opt/dnsmonster --depth 1 \ && cd /opt/dnsmonster/src \ - && export RELEASE_VERSION=`git describe --tags` \ - && go build --ldflags "-L /usr/lib/libcap.a -linkmode external -X main.RELEASE_VERSION=$RELEASE_VERSION -extldflags \"-static\"" -o /tmp/dnsmonster-linux-amd64.bin + && export LATEST_TAG=`git describe --tags` \ + && go build --ldflags "-L /usr/lib/libcap.a -linkmode external -X main.releaseVersion=$LATEST_TAG -extldflags \"-static\"" -o /tmp/dnsmonster-linux-amd64.bin ENV CGO_ENABLED=1 diff --git a/src/main.go b/src/main.go index e3f95f6..eb9da55 100644 --- a/src/main.go +++ b/src/main.go @@ -21,7 +21,7 @@ import ( "github.com/namsral/flag" ) -const RELEASE_VERSION = "DEVELOPMENT" +var releaseVersion string = "DEVELOPMENT" type splunkOutputEndpointList []string @@ -121,7 +121,7 @@ func checkFlags() { errorHandler(err) if *version { - log.Fatalln("dnsmonster version:", RELEASE_VERSION) + log.Fatalln("dnsmonster version:", releaseVersion) } //TODO: log format needs to be a configurable parameter