add version strings to the nightly builds of nats cli

Signed-off-by: R.I.Pienaar <rip@devco.net>
This commit is contained in:
R.I.Pienaar
2021-02-24 20:12:47 +01:00
parent 338e017dbe
commit 693f9959a2
2 changed files with 5 additions and 1 deletions

View File

@@ -19,6 +19,8 @@ dockers:
goarch: amd64 goarch: amd64
skip_push: true skip_push: true
dockerfile: docker/Dockerfile.nightly dockerfile: docker/Dockerfile.nightly
build_flag_templates:
- '--build-arg=VERSION=nightly-{{ time "20060102" }}'
image_templates: image_templates:
- synadia/nats-server:{{.Version}} - synadia/nats-server:{{.Version}}
- synadia/nats-server:nightly - synadia/nats-server:nightly

View File

@@ -1,11 +1,13 @@
FROM golang:1.15-alpine AS builder FROM golang:1.15-alpine AS builder
ARG VERSION="nightly"
RUN apk add --update git RUN apk add --update git
RUN mkdir -p src/github.com/nats-io && \ RUN mkdir -p src/github.com/nats-io && \
cd src/github.com/nats-io/ && \ cd src/github.com/nats-io/ && \
git clone https://github.com/nats-io/natscli.git && \ git clone https://github.com/nats-io/natscli.git && \
cd natscli/nats && \ cd natscli/nats && \
go build -o /nats go build -ldflags "-s -w -X main.version=${VERSION}" -o /nats
RUN go get github.com/nats-io/nsc RUN go get github.com/nats-io/nsc