diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index f5d2456..e1aee12 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -55,7 +55,7 @@ jobs: build-args: | VERSION=${{ steps.infos.outputs.version }} COMMIT=${{ github.sha }} - COMMIT_DATE=${{ steps.infos.outputs.date }} + DATE=${{ steps.infos.outputs.date }} # This step calls the container workflow to generate provenance and push it to # the container registry. diff --git a/Dockerfile b/Dockerfile index 14f2276..07b7395 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,9 @@ COPY . . ENV CGO_ENABLED=0 ARG VERSION="dev" ARG COMMIT -ARG COMMIT_DATE +ARG DATE RUN go build -cover \ - -ldflags="-s -w -X 'main.Version="$VERSION"' -X 'main.Commit="$COMMIT"' -X 'main.CommitDate="$COMMIT_DATE"'" \ + -ldflags="-s -w -X 'main.version="$VERSION"' -X 'main.commit="$COMMIT"' -X 'main.date="$DATE"' -X 'main.builtBy=docker'" \ -o /go/bin/ctfd-setup \ cmd/ctfd-setup/main.go diff --git a/cmd/ctfd-setup/main.go b/cmd/ctfd-setup/main.go index 1b0d39c..d070757 100644 --- a/cmd/ctfd-setup/main.go +++ b/cmd/ctfd-setup/main.go @@ -15,9 +15,10 @@ import ( ) var ( - Version = "dev" - Commit = "" - CommitDate = "" + version = "dev" + commit = "" + date = "" + builtBy = "" ) const ( @@ -434,11 +435,12 @@ func main() { Email: "lucastesson@protonmail.com", }, }, - Version: Version, + Version: version, Metadata: map[string]any{ - "version": Version, - "commit": Commit, - "date": CommitDate, + "version": version, + "commit": commit, + "date": date, + "builtBy": builtBy, }, }