feat(utils): use commit timestamp to generate project version tags

This commit is contained in:
wpetit 2023-08-24 07:51:05 -06:00
parent efbdad226c
commit 7da0dd95b1

View File

@ -66,8 +66,9 @@ List<String> getProjectVersionTags(String overrideChannel = '') {
String channel = overrideChannel ? overrideChannel : getProjectVersionDefaultChannel()
String shortChannel = getProjectVersionShortChannel(channel)
String dateVersion = sh(script: 'date +%Y.%-m.%-d', returnStdout: true).trim()
String timestamp = sh(script: 'date +%-H%M', returnStdout: true).trim()
String currrentCommitDate = sh(script: 'git show -s --format=%ct').trim()
String dateVersion = sh(script: "TZ=Europe/Paris date -d '@${currrentCommitDate}' +%Y.%-m.%-d", returnStdout: true).trim()
String timestamp = sh(script: "TZ=Europe/Paris date -d '@${currrentCommitDate}' +%-H%M", returnStdout: true).trim()
String shortCommit = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
String longTag = "${dateVersion}-${channel}.${timestamp}.${shortCommit}"