Skip to content

Commit

Permalink
Merge pull request #53 from TeoZosa/add-strong-version-tagging-functi…
Browse files Browse the repository at this point in the history
…onality

✨ Add Strong Version Tagging Functionality

Closes RND-879.
  • Loading branch information
TeoZosa authored Jan 31, 2021
2 parents 0390b43 + 72f78f6 commit 0abd9a9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions {{cookiecutter.project_slug}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ SHELL := bash
PROJECT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PROJECT_NAME := $(shell basename $(PROJECT_DIR))

# List any changed files (excluding submodules)
CHANGED_FILES := $(shell git diff --name-only)

ifeq ($(strip $(CHANGED_FILES)),)
GIT_VERSION := $(shell git describe --tags --long --always)
else
diff_checksum := $(shell git diff | shasum -a 256 | cut -c -6)
GIT_VERSION := $(shell git describe --tags --long --always --dirty)-$(diff_checksum)
endif
TAG := $(shell date +v%Y%m%d)-$(GIT_VERSION)

.PHONY: strong-version-tag
strong-version-tag:
@echo $(TAG)

.PHONY: strong-version-tag-dateless
strong-version-tag-dateless:
@echo $(GIT_VERSION)
#################################################################################
# COMMANDS #
#################################################################################
Expand Down

0 comments on commit 0abd9a9

Please sign in to comment.