More setup about the deployment
This commit is contained in:
1 parent
821332508f
commit
20b8fcc1c1
5 files changed
+22
-7
No files matched your search
+16
-5
@@ -5,7 +5,8 @@ Reproduit « Outils > Freebox SDK > Make FreeStore Package » du plugin QtCreato
|
||||
(github.com/fbx/freebox-qtcreator-plugin, src/freestorepackager.cc) :
|
||||
- fichiers inclus comme dans Jellyfin.fbxproject : QML, JS, images, polices, qmldir et
|
||||
manifest.json (tools/ est exclu : l'aperçu PC n'a rien à faire sur la box) ;
|
||||
- vérifications : manifest.json (identifiant, points d'entrée existants), JSON valides,
|
||||
- vérifications : manifest.json (identifiant, version identique à Session.clientVersion,
|
||||
points d'entrée existants), JSON valides,
|
||||
syntaxe QML/JS (qmllint, s'il est installé) ;
|
||||
- archive tar (format ustar, avec les entrées de dossiers) compressée en gzip.
|
||||
|
||||
@@ -70,6 +71,15 @@ def check_manifest(files):
|
||||
defaults += 1
|
||||
if defaults > 1:
|
||||
raise ValueError("manifest.json : un seul point d'entrée peut avoir « default »: true")
|
||||
version = manifest.get("version")
|
||||
if not isinstance(version, str) or not re.fullmatch(r"\d+\.\d+\.\d+", version):
|
||||
raise ValueError("manifest.json : « version » absente ou invalide (forme attendue : 1.2.3)")
|
||||
# La version envoyée à Jellyfin (Session.clientVersion) doit rester la même.
|
||||
session = open(os.path.join(PROJECT_DIR, "Core", "Session.qml"), encoding="utf-8").read()
|
||||
client = re.search(r'clientVersion:\s*"([^"]*)"', session)
|
||||
if not client or client.group(1) != version:
|
||||
raise ValueError("version du manifest (%s) différente de Session.clientVersion (%s)"
|
||||
% (version, client.group(1) if client else "introuvable"))
|
||||
icon = manifest.get("icon")
|
||||
if icon and icon not in files:
|
||||
raise ValueError("manifest.json : icône « %s » absente du paquet" % icon)
|
||||
@@ -118,7 +128,7 @@ def build_archive(files, output):
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description=__doc__.splitlines()[0])
|
||||
parser.add_argument("--output", help="archive à créer (défaut : dist/<identifier>.tar.gz)")
|
||||
parser.add_argument("--output", help="archive à créer (défaut : dist/<identifier>-<version>.tar.gz)")
|
||||
args = parser.parse_args()
|
||||
|
||||
files = collect_files()
|
||||
@@ -128,10 +138,11 @@ def main():
|
||||
except (ValueError, json.JSONDecodeError) as error:
|
||||
sys.exit("Paquet non créé : %s" % error)
|
||||
|
||||
output = args.output or os.path.join(PROJECT_DIR, "dist", manifest["identifier"] + ".tar.gz")
|
||||
output = args.output or os.path.join(
|
||||
PROJECT_DIR, "dist", "%s-%s.tar.gz" % (manifest["identifier"], manifest["version"]))
|
||||
build_archive(files, output)
|
||||
print("Paquet créé : %s (%d fichiers, %.1f Ko)" % (
|
||||
os.path.relpath(output, os.getcwd()), len(files), os.path.getsize(output) / 1024))
|
||||
print("Paquet créé : %s — version %s (%d fichiers, %.1f Ko)" % (
|
||||
os.path.relpath(output, os.getcwd()), manifest["version"], len(files), os.path.getsize(output) / 1024))
|
||||
print("À téléverser sur la console FreeFactory (http://factory.free.fr).")
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user