[cpack/jenkins-main] update commit date format string to something that works on all machines
This commit is contained in:
Vendored
+2
-2
@@ -258,8 +258,8 @@ def CheckoutRepo(boolean disableSubmodules = false) {
|
||||
palRm('commitid')
|
||||
|
||||
// CHANGE_DATE is used by the installer to provide some ability to sort tagged builds in addition to BRANCH_NAME and CHANGE_ID
|
||||
commitDateFmt = '%%cs'
|
||||
if (env.IS_UNIX) commitDateFmt = '%cs'
|
||||
commitDateFmt = '%%cI'
|
||||
if (env.IS_UNIX) commitDateFmt = '%cI'
|
||||
|
||||
palSh("git show -s --format=${commitDateFmt} ${env.CHANGE_ID} > commitdate", 'Getting commit date')
|
||||
env.CHANGE_DATE = readFile file: 'commitdate'
|
||||
|
||||
@@ -66,7 +66,8 @@ if __name__ == "__main__":
|
||||
# include the commit date to allow some sensible way of sorting
|
||||
commit_date = os.environ.get('CHANGE_DATE')
|
||||
if not commit_date:
|
||||
commit_date = run_git_command(['show', '-s', '--format=%cs', commit_hash], repo_root)
|
||||
commit_date = run_git_command(['show', '-s', '--format=%cI', commit_hash], repo_root)
|
||||
commit_date = commit_date[0:10]
|
||||
|
||||
print(f'{branch}/{commit_date}-{commit_hash}')
|
||||
exit(0)
|
||||
|
||||
Reference in New Issue
Block a user