Merge pull request #71 from truenas/automated-updates

Add metadata to allow automated updates of catalog item(s)
This commit is contained in:
Rick Mesta
2021-06-21 15:14:59 -05:00
committed by GitHub
10 changed files with 127 additions and 0 deletions

View File

@@ -0,0 +1 @@
{"filename": "ix_values.yaml", "keys": ["image"]}

24
charts/chia/upgrade_strategy Executable file
View File

@@ -0,0 +1,24 @@
#!/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]
version = semantic_versioning(image_tags[key])
if not version:
return {}
return {
'tags': {key: version},
'app_version': version,
}
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))

View File

@@ -0,0 +1 @@
{"filename": "ix_values.yaml", "keys": ["image"]}

24
charts/ipfs/upgrade_strategy Executable file
View File

@@ -0,0 +1,24 @@
#!/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]
version = semantic_versioning(image_tags[key])
if not version:
return {}
return {
'tags': {key: version},
'app_version': version,
}
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))

View File

@@ -0,0 +1 @@
{"filename": "ix_values.yaml", "keys": ["image"]}

25
charts/minio/upgrade_strategy Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/python3
import json
import sys
from catalog_update.upgrade_strategy import datetime_versioning
def newer_mapping(image_tags):
key = list(image_tags.keys())[0]
tags = {t.strip('RELEASE.'): t for t in image_tags[key] if t.startswith('RELEASE.') and t.endswith('Z')}
version = datetime_versioning(list(tags), '%Y-%m-%dT%H-%M-%SZ')
if not version:
return {}
return {
'tags': {key: tags[version]},
'app_version': version,
}
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))

View File

@@ -0,0 +1 @@
{"filename": "ix_values.yaml", "keys": ["image"]}

View File

@@ -0,0 +1,24 @@
#!/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]
version = semantic_versioning(image_tags[key])
if not version:
return {}
return {
'tags': {key: version},
'app_version': version,
}
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))

View File

@@ -0,0 +1 @@
{"filename": "ix_values.yaml", "keys": ["image"]}

25
charts/plex/upgrade_strategy Executable file
View File

@@ -0,0 +1,25 @@
#!/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]
tags = {t.rsplit('-', 1)[0]: t for t in image_tags[key]}
version = semantic_versioning(list(tags))
if not version:
return {}
return {
'tags': {key: tags[version]},
'app_version': version,
}
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
print(json.dumps(newer_mapping(json.loads(sys.argv[1]))))