Skip to content

Commit

Permalink
Git Commit timestamp (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
goruha authored Mar 30, 2018
1 parent 505c2ad commit 2f23366
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/git/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ git/show:
@echo "latest tag - $(GIT_LATEST_TAG)"
@echo "tag - $(GIT_IS_TAG)"
@echo "branch - $(GIT_IS_BRANCH)"
@echo "timestamp - $(GIT_TIMESTAMP)"

## Export git vars
git/export:
Expand All @@ -26,3 +27,4 @@ git/export:
@echo "GIT_LATEST_TAG=$(GIT_LATEST_TAG)"
@echo "GIT_IS_BRANCH=$(GIT_IS_BRANCH)"
@echo "GIT_IS_TAG=$(GIT_IS_TAG)"
@echo "GIT_TIMESTAMP=$(GIT_TIMESTAMP)"
2 changes: 2 additions & 0 deletions modules/git/bootstrap.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export GIT_COMMIT_SHORT ?= $(shell $(GIT) rev-parse --verify --short HEAD)
export GIT_BRANCH ?= $(shell $(GIT) rev-parse --abbrev-ref HEAD)
export GIT_LATEST_TAG ?= $(shell $(GIT) describe --tags --abbrev=0 2>/dev/null)

export GIT_TIMESTAMP ?= $(shell $(GIT) log -1 --format=%ct 2>/dev/null)

ifeq ($(GIT_LATEST_TAG),)
export GIT_LATEST_TAG="0.0.0"
endif
Expand Down

0 comments on commit 2f23366

Please sign in to comment.