Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Websoft9/docker-library int…
Browse files Browse the repository at this point in the history
…o main
  • Loading branch information
qiaofeng1227 committed Oct 24, 2024
2 parents 1ca7006 + 117dcd3 commit f7ecf6d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions build/get_apps_latest_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,19 @@ def find_latest_version(tags, current_version):
tag_ver = version.parse(tag_name)
all_versions.append(tag_name)
if tag_ver > current_ver:
print(f"Comparing {tag_name} with current version {current_version}:")
if latest_version is None or tag_ver > version.parse(latest_version['version']):
print(f"New latest version found: {tag_name}")
latest_version = {
'version': tag_name,
'last_updated': tag['last_updated']
}
except version.InvalidVersion:
print(f"Invalid version format found: {tag_name}")
continue

return latest_version, all_versions

def main():
parser = argparse.ArgumentParser(description='Fetch Docker Hub tags and find the latest version.')
parser.add_argument('--max-pages', type=int, default=5, help='Maximum number of pages to fetch from Docker Hub API')
parser.add_argument('--max-pages', type=int, default=1, help='Maximum number of pages to fetch from Docker Hub API')
parser.add_argument('--page-size', type=int, default=100, help='Number of tags to fetch per page from Docker Hub API')
args = parser.parse_args()

Expand All @@ -106,7 +103,6 @@ def main():
'name': name,
'current_version': 'N/A',
'latest_version': None,
'all_versions': [],
'version_from': version_from,
'error': 'No valid current versions found'
})
Expand Down Expand Up @@ -141,18 +137,14 @@ def main():
output.append({
'name': name,
'current_version': current_version_strs,
'highest_version': highest_version_str,
'latest_version': latest_version,
'all_versions': all_versions,
'version_from': version_from
})
else:
output.append({
'name': name,
'current_version': current_version_strs,
'highest_version': highest_version_str,
'latest_version': None,
'all_versions': [],
'version_from': version_from,
'error': 'Invalid version_from URL or not a Docker Hub URL'
})
Expand Down

0 comments on commit f7ecf6d

Please sign in to comment.