feat(version): use commit timestamp to generate project version
Cadoles/mktools/pipeline/head This commit looks good Details

This commit is contained in:
wpetit 2023-08-24 07:58:54 -06:00
parent 3308856636
commit 5a0e3edc8e
1 changed files with 3 additions and 2 deletions

View File

@ -19,8 +19,9 @@ else
MKT_PROJECT_SHORT_VERSION_CHANNEL ?= $(shell echo "$(MKT_PROJECT_VERSION_CHANNEL)" | sed -e 's/[aeiouy]//g' | cut -c1-3) MKT_PROJECT_SHORT_VERSION_CHANNEL ?= $(shell echo "$(MKT_PROJECT_VERSION_CHANNEL)" | sed -e 's/[aeiouy]//g' | cut -c1-3)
endif endif
MKT_PROJECT_VERSION_DATE ?= $(shell date +%Y.%-m.%-d) MKT_PROJECT_VERSION_COMMIT_TIMESTAMP ?= $(shell git show -s --format=%ct)
MKT_PROJECT_VERSION_TIMESTAMP ?= $(shell date +%-H%M) MKT_PROJECT_VERSION_DATE ?= $(shell TZ=Europe/Paris date -d '@$(MKT_PROJECT_VERSION_COMMIT_TIMESTAMP)' +%Y.%-m.%-d)
MKT_PROJECT_VERSION_TIMESTAMP ?= $(shell TZ=Europe/Paris date -d '@$(MKT_PROJECT_VERSION_COMMIT_TIMESTAMP)' +%-H%M)
MKT_PROJECT_VERSION ?= $(MKT_PROJECT_VERSION_DATE)-$(MKT_PROJECT_VERSION_CHANNEL).$(MKT_PROJECT_VERSION_TIMESTAMP).$(shell git rev-parse --short HEAD) MKT_PROJECT_VERSION ?= $(MKT_PROJECT_VERSION_DATE)-$(MKT_PROJECT_VERSION_CHANNEL).$(MKT_PROJECT_VERSION_TIMESTAMP).$(shell git rev-parse --short HEAD)
MKT_PROJECT_SHORT_VERSION ?= $(MKT_PROJECT_VERSION_DATE)-$(MKT_PROJECT_SHORT_VERSION_CHANNEL).$(MKT_PROJECT_VERSION_TIMESTAMP) MKT_PROJECT_SHORT_VERSION ?= $(MKT_PROJECT_VERSION_DATE)-$(MKT_PROJECT_SHORT_VERSION_CHANNEL).$(MKT_PROJECT_VERSION_TIMESTAMP)