From 5abe33e487999ac08a939de7d024aae70a75b34d Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 24 Aug 2023 12:41:11 -0600 Subject: [PATCH] fix(version): normalize variable names --- tasks/version.mk | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tasks/version.mk b/tasks/version.mk index 9c6a9ab..495dc91 100644 --- a/tasks/version.mk +++ b/tasks/version.mk @@ -1,12 +1,13 @@ -MKT_PROJECT_BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD) -MKT_PROJECT_CLEANED_BRANCH_NAME ?= $(shell echo $(MKT_PROJECT_BRANCH_NAME) | tr '[:upper:]' '[:lower:]' | sed -e 's/[-_ ]//g') +MKT_PROJECT_VERSION_TIMEZONE ?= Europe/Paris +MKT_PROJECT_VERSION_BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD) +MKT_PROJECT_VERSION_CLEANED_BRANCH_NAME ?= $(shell echo $(MKT_PROJECT_VERSION_BRANCH_NAME) | tr '[:upper:]' '[:lower:]' | sed -e 's/[-_ ]//g') -ifeq ($(MKT_PROJECT_CLEANED_BRANCH_NAME),master) +ifeq ($(MKT_PROJECT_VERSION_CLEANED_BRANCH_NAME),master) MKT_PROJECT_VERSION_CHANNEL = stable -else ifeq ($(MKT_PROJECT_CLEANED_BRANCH_NAME),staging) +else ifeq ($(MKT_PROJECT_VERSION_CLEANED_BRANCH_NAME),staging) MKT_PROJECT_VERSION_CHANNEL = testing else - MKT_PROJECT_VERSION_CHANNEL = $(MKT_PROJECT_CLEANED_BRANCH_NAME) + MKT_PROJECT_VERSION_CHANNEL = $(MKT_PROJECT_VERSION_CLEANED_BRANCH_NAME) endif @@ -21,8 +22,8 @@ else endif MKT_PROJECT_VERSION_COMMIT_TIMESTAMP ?= $(shell git show -s --format=%ct) -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_DATE ?= $(shell TZ=$(MKT_PROJECT_VERSION_TIMEZONE) date -d '@$(MKT_PROJECT_VERSION_COMMIT_TIMESTAMP)' +%Y.%-m.%-d) +MKT_PROJECT_VERSION_TIMESTAMP ?= $(shell TZ=$(MKT_PROJECT_VERSION_TIMEZONE) 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_SHORT_VERSION ?= $(MKT_PROJECT_VERSION_DATE)-$(MKT_PROJECT_SHORT_VERSION_CHANNEL).$(MKT_PROJECT_VERSION_TIMESTAMP)