Commits
Ville Suoranta authored 7058fb0389d Merge
63 63 | #print(pattern) |
64 64 | p = re.compile(pattern) |
65 65 | if p.match(tag): |
66 66 | return tag |
67 67 | |
68 68 | return release_pre_filter |
69 69 | |
70 70 | |
71 71 | def get_last_tag(sourcedir, branch, number_of_elements): |
72 72 | |
73 + | # Pipeline branch names are very long. Tags are created as PIPE-xyz ticket numbers instead. |
74 + | jira_prefix="PIPE-" |
75 + | if jira_prefix in branch: |
76 + | r = re.compile(r'(\d+)') |
77 + | branch = jira_prefix + r.match(branch.split(jira_prefix)[1]).groups()[0] |
78 + | |
73 79 | # Get the remote to determine the repository type. |
74 80 | # Using the remote name should be safer than assuming that the checked out |
75 81 | # repository is not renamed |
76 82 | process = subprocess.Popen(['git', 'config', '--get', 'remote.origin.url'], stdout=subprocess.PIPE, |
77 83 | stderr=subprocess.STDOUT, cwd=sourcedir) |
78 84 | stdout, stderr = process.communicate() |
79 85 | remote = stdout.decode("utf-8").split()[0] |
80 86 | |
81 87 | process = subprocess.Popen(['git', 'tag', '-l'], stdout=subprocess.PIPE, |
82 88 | stderr=subprocess.STDOUT, cwd=sourcedir) |