diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 113ac34f..ad9acf36 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,7 +73,7 @@ jobs: BRANCH=${GITHUB_REF#refs/heads/} TAG=${GITHUB_REF#refs/tags/} echo ::set-output name=commit::$(git rev-parse --short HEAD) - echo ::set-output name=build_date::$(date -u +%Y-%m-%dT%H:%M:%SZ) + echo ::set-output name=created::$(date -u +%Y-%m-%dT%H:%M:%SZ) if [ "$TAG" != "$GITHUB_REF" ]; then echo ::set-output name=version::$TAG echo ::set-output name=platforms::linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7,linux/ppc64le @@ -90,7 +90,7 @@ jobs: with: platforms: ${{ steps.vars.outputs.platforms }} build-args: | - BUILD_DATE=${{ steps.vars.outputs.build_date }} + CREATED=${{ steps.vars.outputs.created }} COMMIT=${{ steps.vars.outputs.commit }} VERSION=${{ steps.vars.outputs.version }} ALLTARGETPLATFORMS=${{ steps.vars.outputs.platforms }} diff --git a/Dockerfile b/Dockerfile index f3bfb692..7a7c29c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,24 +43,24 @@ FROM --platform=${BUILDPLATFORM} base AS build ARG TARGETPLATFORM ARG ALLTARGETPLATFORMS=${TARGETPLATFORM} ARG VERSION=unknown -ARG BUILD_DATE="an unknown date" +ARG CREATED="an unknown date" ARG COMMIT=unknown RUN xcputranslate sleep -targetplatform ${TARGETPLATFORM} -buildtime=10s -order=${ALLTARGETPLATFORMS} RUN GOARCH="$(xcputranslate translate -field arch -targetplatform ${TARGETPLATFORM})" \ GOARM="$(xcputranslate translate -field arm -targetplatform ${TARGETPLATFORM})" \ go build -trimpath -ldflags="-s -w \ -X 'main.version=$VERSION' \ - -X 'main.buildDate=$BUILD_DATE' \ + -X 'main.buildDate=$CREATED' \ -X 'main.commit=$COMMIT' \ " -o entrypoint cmd/gluetun/main.go FROM alpine:${ALPINE_VERSION} ARG VERSION=unknown -ARG BUILD_DATE="an unknown date" +ARG CREATED="an unknown date" ARG COMMIT=unknown LABEL \ org.opencontainers.image.authors="quentin.mcgaw@gmail.com" \ - org.opencontainers.image.created=$BUILD_DATE \ + org.opencontainers.image.created=$CREATED \ org.opencontainers.image.version=$VERSION \ org.opencontainers.image.revision=$COMMIT \ org.opencontainers.image.url="https://github.com/qdm12/gluetun" \ diff --git a/cmd/gluetun/main.go b/cmd/gluetun/main.go index 946dd5c8..cddcb861 100644 --- a/cmd/gluetun/main.go +++ b/cmd/gluetun/main.go @@ -43,9 +43,9 @@ import ( //nolint:gochecknoglobals var ( - version = "unknown" - commit = "unknown" - buildDate = "an unknown date" + version = "unknown" + commit = "unknown" + created = "an unknown date" ) var ( @@ -55,9 +55,9 @@ var ( func main() { buildInfo := models.BuildInformation{ - Version: version, - Commit: commit, - BuildDate: buildDate, + Version: version, + Commit: commit, + Created: created, } ctx := context.Background() diff --git a/internal/logging/splash.go b/internal/logging/splash.go index eabebb13..eed12163 100644 --- a/internal/logging/splash.go +++ b/internal/logging/splash.go @@ -15,7 +15,7 @@ func Splash(buildInfo models.BuildInformation) string { lines := title() lines = append(lines, "") lines = append(lines, fmt.Sprintf("Running version %s built on %s (commit %s)", - buildInfo.Version, buildInfo.BuildDate, buildInfo.Commit)) + buildInfo.Version, buildInfo.Created, buildInfo.Commit)) lines = append(lines, "") lines = append(lines, announcement()...) lines = append(lines, "") diff --git a/internal/models/build.go b/internal/models/build.go index 8f877632..c0a02094 100644 --- a/internal/models/build.go +++ b/internal/models/build.go @@ -1,7 +1,7 @@ package models type BuildInformation struct { - Version string `json:"version"` - Commit string `json:"commit"` - BuildDate string `json:"build_date"` + Version string `json:"version"` + Commit string `json:"commit"` + Created string `json:"created"` }