Cron job to check for and update images (#249)

Co-authored-by: Marco Franssen <[email protected]>
This commit is contained in:
kfox1111
2023-08-18 09:49:50 +02:00
committed by GitHub
co-authored by Marco Franssen
parent b7e15255f3
commit 77fe43f37d
6 changed files with 171 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
import os
import sys
from dict_deep import deep_set
import ruamel.yaml
def represent_none(self, data):
return self.represent_scalar(u'tag:yaml.org,2002:null', u'null')
y = ruamel.yaml.YAML()
y.indent(mapping=2, sequence=4, offset=2)
# Dont wrap long lines
y.width = 4096
y.preserve_quotes = True
y.representer.add_representer(type(None), represent_none)
d = y.load(open(os.environ['VALUES']))
tagquery = os.environ['QUERY'] + '.tag'
deep_set(d, tagquery, os.environ['LATEST_VERSION']);
y.dump(d, sys.stdout)