Files
chart/library/ix-dev/charts/nextcloud/upgrade_strategy
Stavros Kois 91261f378f Move nextcloud to ix-dev (#1050)
* move nextcloud to ix-dev

* fix probe and update lock

* indent
2023-03-24 23:27:53 +02:00

28 lines
676 B
Python
Executable File

#!/usr/bin/python3
import json
import sys
from catalog_update.upgrade_strategy import semantic_versioning
def newer_mapping(image_tags):
key = list(image_tags.keys())[0]
# 21.1 is greater then 21.1.0 so we reverse sort bfeore doing semantic versioning
version = semantic_versioning(sorted(image_tags[key], reverse=True))
if not version:
return {}
return {
'tags': {key: version},
'app_version': version,
}
if __name__ == '__main__':
try:
versions_json = json.loads(sys.stdin.read())
except ValueError:
raise ValueError('Invalid json specified')
print(json.dumps(newer_mapping(versions_json)))