diff --git a/.github/workflows/builder.yaml b/.github/workflows/builder.yaml index 52af04c1..898c728b 100644 --- a/.github/workflows/builder.yaml +++ b/.github/workflows/builder.yaml @@ -59,5 +59,5 @@ jobs: labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 build-args: | - buildRelease=${{ github.ref_name }} + version=${{ github.ref_name }} outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=gRPC Mock Server diff --git a/Dockerfile b/Dockerfile index 0a8353a8..da26e53e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.source=https://github.com/bavix/gripmock LABEL org.opencontainers.image.description="gRPC Mock Server" LABEL org.opencontainers.image.licenses=Apache-2.0 -ARG buildRelease +ARG version # install tools (git, protobuf, protoc-gen-go, protoc-grn-go-grpc) RUN apk -U --no-cache add git protobuf curl &&\ @@ -29,7 +29,7 @@ COPY . /go/src/github.com/bavix/gripmock RUN cd /go/src/github.com/bavix/gripmock/protoc-gen-gripmock &&\ go install -v -ldflags "-s -w" &&\ cd /go/src/github.com/bavix/gripmock &&\ - go install -v -ldflags "-X 'main.buildRelease=${buildRelease:-dev}' -s -w" + go install -v -ldflags "-X 'main.version=${version:-dev}' -s -w" WORKDIR /go/src/github.com/bavix/gripmock diff --git a/main.go b/main.go index 206d481f..712bdf74 100644 --- a/main.go +++ b/main.go @@ -28,7 +28,7 @@ import ( "github.com/bavix/gripmock/stub" ) -var buildRelease string //nolint:gochecknoglobals +var version string //nolint:funlen,cyclop func main() { @@ -81,7 +81,7 @@ func main() { //nolint:godox // fixme: move validation of required arguments to a separate service - logger.Info().Str("release", buildRelease).Msg("Starting GripMock") + logger.Info().Str("release", version).Msg("Starting GripMock") if os.Getenv("GOPATH") == "" { logger.Fatal().Msg("$GOPATH is empty") }