Skip to content
Snippets Groups Projects
Commit 5a6ea947 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV
Browse files

updating finding the latest tag

parent 4f123811
No related branches found
No related tags found
1 merge request!85Correcting release script: sorting tags, corrected version bump, updated help docs
......@@ -115,9 +115,9 @@ def _update_readme(readme, version=None):
return '\n'.join(new_readme)
def get_latest_tag(gitpkg):
def get_latest_tag_name(gitpkg):
# get 50 latest tags as a list
latest_tags = gitpkg.tags.list(per_page=50, page=1)
latest_tags = gitpkg.tags.list(all=True)
if not latest_tags:
return None
# create list of tags' names but ignore the first 'v' character in each name
......@@ -143,7 +143,7 @@ def get_parsed_tag(gitpkg, tag):
if 'patch' == tag or 'minor' == tag or 'major' == tag:
# find the correct latest tag of this package (without 'v' in front),
# None if there are no tags yet
latest_tag_name = get_latest_tag(gitpkg)
latest_tag_name = get_latest_tag_name(gitpkg)
# if there were no tags yet, assume the very first version
if not latest_tag_name:
return 'v0.0.1'
......@@ -215,7 +215,7 @@ def just_build_package(gitpkg, dry_run=False):
last_pipeline = get_last_nonskip_pipeline(gitpkg, before_last=True)
# check that the chosen pipeline is the one we are looking for
latest_tag_name = gitpkg.tags.list(per_page=1, page=1)[0].name
latest_tag_name = get_latest_tag_name(gitpkg)
# the pipeline should be the one built for the latest tag, so check if it is the correct choice
if last_pipeline.ref != latest_tag_name:
raise ValueError('While deploying {0}, found pipeline {1} but it does not match '
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment