1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
8 class VersionInfoFromGit():
9 """Return arvados version from git
11 def git_latest_tag(self):
12 gitinfo = subprocess.check_output(
13 ['git', 'describe', '--abbrev=0']).strip()
14 return str(gitinfo.decode('utf-8'))
16 def git_timestamp_tag(self):
17 gitinfo = subprocess.check_output(
18 ['git', 'log', '--first-parent', '--max-count=1',
19 '--format=format:%ct', '.']).strip()
20 return str(time.strftime('.%Y%m%d%H%M%S', time.gmtime(int(gitinfo))))