Yoloadd an app catalog v3 + tools to convert apps from v1 to v2

This commit is contained in:
Alexandre Aubin
2022-08-03 21:02:49 +02:00
parent 6008102e3b
commit 806c4ae1fd
5 changed files with 400 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/python3
import copy
import sys
import os
import re
@ -8,6 +9,8 @@ import subprocess
import yaml
import time
from tools.packaging_v2.convert_v1_manifest_to_v2_for_catalog import convert_v1_manifest_to_v2_for_catalog
now = time.time()
catalog = json.load(open("apps.json"))
@ -187,6 +190,27 @@ def build_catalog():
)
)
###################################
# Catalog API v3 with manifest v2 #
###################################
result_dict_with_manifest_v2 = copy.deepcopy(result_dict)
for app in result_dict_with_manifest_v2:
app["manifest"] = convert_v1_manifest_to_v2_for_catalog(app["manifest"])
os.system("mkdir -p ./builds/default/v3/")
with open("builds/default/v3/apps.json", "w") as f:
f.write(
json.dumps(
{
"apps": result_dict_with_manifest_v2,
"categories": categories,
"antifeatures": antifeatures,
},
sort_keys=True,
)
)
##############################
# Version for catalog in doc #
##############################