Skip to content

Commit

Permalink
Build date fix (#956)
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps committed Jul 24, 2022
1 parent e2b8e74 commit d507232
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
This format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Fixed

- Build date was incorrect and always showed current date/time

## [v1.9.0](https://github.com/markphelps/flipt/releases/tag/v1.9.0) - 2022-07-06

### Changed
Expand Down
4 changes: 3 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ tasks:
desc: Build the binary
deps: [prep]
cmds:
- go build -trimpath -tags assets -ldflags "-X main.commit={{.GIT_COMMIT}}" -o ./bin/{{.PROJECT}} ./cmd/{{.PROJECT}}/.
- go build -trimpath -tags assets -ldflags "-X main.commit={{.GIT_COMMIT}} -X main.date={{.BUILD_DATE}}" --o ./bin/{{.PROJECT}} ./cmd/{{.PROJECT}}/.
vars:
GIT_COMMIT:
sh: set -e && git rev-parse --verify HEAD || ""
BUILD_DATE:
sh: date -u +%Y-%m-%dT%H:%M:%SZ

prep:
desc: Prepare for release
Expand Down
2 changes: 1 addition & 1 deletion cmd/flipt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var (

version = devVersion
commit string
date = time.Now().UTC().Format(time.RFC3339)
date string
goVersion = runtime.Version()
analyticsKey string
banner string
Expand Down

0 comments on commit d507232

Please sign in to comment.