Gets the version number and checks if that tag exists
(options)
| 212 | return '%s%s%s' % (version, channel, suffix) |
| 213 | |
| 214 | def git_sha1_from_version_file(options): |
| 215 | """ Gets the version number and checks if that tag exists """ |
| 216 | with open('../VERSION', 'r', encoding='utf-8') as version_file: |
| 217 | version = version_file.read().strip() |
| 218 | |
| 219 | tag_name = _get_tag_name(version, options.channel) |
| 220 | |
| 221 | process = subprocess.Popen(['git', 'rev-list', '-n', '1', tag_name], stdout = subprocess.PIPE, stderr = subprocess.DEVNULL) |
| 222 | out, err = process.communicate() |
| 223 | if process.returncode != 0: |
| 224 | log("Unable to find git sha from tag=%s" % tag_name) |
| 225 | return None |
| 226 | |
| 227 | if isinstance(out, (bytes, bytearray)): |
| 228 | out = str(out, encoding='utf-8') |
| 229 | return out.strip() |
| 230 | |
| 231 | def git_sha1(ref = 'HEAD'): |
| 232 | try: |
no test coverage detected