diff --git a/.goreleaser.yml b/.goreleaser.yml index 7484c1f..f557dad 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,7 +9,7 @@ builds: - CGO_ENABLED=0 main: ./cmd/hetty ldflags: - - -s -w -X main.version=v{{.Version}} + - -s -w -X main.version={{.Version}} goos: - linux - windows diff --git a/Dockerfile b/Dockerfile index 79055cc..fea0d3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ -ARG GO_VERSION=1.16 -ARG NODE_VERSION=14.11 -ARG ALPINE_VERSION=3.12 - -ARG CGO_ENABLED=0 +ARG GO_VERSION=1.17 +ARG NODE_VERSION=16.13 +ARG ALPINE_VERSION=3.15 FROM node:${NODE_VERSION}-alpine AS node-builder WORKDIR /app @@ -13,14 +11,15 @@ ENV NEXT_TELEMETRY_DISABLED=1 RUN yarn run export FROM golang:${GO_VERSION}-alpine AS go-builder +ARG HETTY_VERSION=0.0.0 +ENV CGO_ENABLED=0 WORKDIR /app -RUN apk add --no-cache build-base COPY go.mod go.sum ./ RUN go mod download COPY cmd ./cmd COPY pkg ./pkg COPY --from=node-builder /app/dist ./cmd/hetty/admin -RUN go build ./cmd/hetty +RUN go build -ldflags="-s -w -X main.version=${HETTY_VERSION}" ./cmd/hetty FROM alpine:${ALPINE_VERSION} WORKDIR /app diff --git a/README.md b/README.md index a4f6621..72fb991 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Usage of ./hetty: You should see: ``` -2020/11/01 14:47:10 [INFO] Running server on :8080 ... +2022/01/26 10:34:24 [INFO] Hetty (v0.3.2) is running on :8080 ... ``` Then, visit [http://localhost:8080](http://localhost:8080) to get started. diff --git a/cmd/hetty/main.go b/cmd/hetty/main.go index 1791351..8b9c1b0 100644 --- a/cmd/hetty/main.go +++ b/cmd/hetty/main.go @@ -27,7 +27,7 @@ import ( "github.com/dstotijn/hetty/pkg/scope" ) -var version = "v0.0.0" +var version = "0.0.0" // Flag variables. var ( @@ -144,7 +144,7 @@ func run() error { TLSNextProto: map[string]func(*http.Server, *tls.Conn, http.Handler){}, // Disable HTTP/2 } - log.Printf("[INFO] Hetty (%v) is running on %v ...", version, addr) + log.Printf("[INFO] Hetty (v%v) is running on %v ...", version, addr) err = s.ListenAndServe() if err != nil && errors.Is(err, http.ErrServerClosed) { diff --git a/docs/src/guide/getting-started.md b/docs/src/guide/getting-started.md index 65e0d93..2559998 100755 --- a/docs/src/guide/getting-started.md +++ b/docs/src/guide/getting-started.md @@ -59,7 +59,7 @@ $ hetty You should see: ``` -2020/11/01 14:47:10 [INFO] Running server on :8080 ... +2022/01/26 10:34:24 [INFO] Hetty (v0.3.2) is running on :8080 ... ``` Then, visit [http://localhost:8080](http://localhost:8080) to get started.