version metadata

pull/31880/head
Justin Newberry 1 year ago
parent 1b426575e7
commit 0524a8a31f
  1. 4
      release/create_casync_channel.py
  2. 12
      system/updated/casync/common.py

@ -3,7 +3,7 @@
import argparse import argparse
import pathlib import pathlib
from openpilot.system.updated.casync.common import create_caexclude_file, create_casync_channel, create_manifest_file from openpilot.system.updated.casync.common import create_caexclude_file, create_casync_channel, create_version_metadata_file
if __name__ == "__main__": if __name__ == "__main__":
@ -16,7 +16,7 @@ if __name__ == "__main__":
target_dir = pathlib.Path(args.target_dir) target_dir = pathlib.Path(args.target_dir)
output_dir = pathlib.Path(args.output_dir) output_dir = pathlib.Path(args.output_dir)
create_manifest_file(target_dir, args.channel) create_version_metadata_file(target_dir, args.channel)
create_caexclude_file(target_dir) create_caexclude_file(target_dir)
digest, caidx = create_casync_channel(target_dir, output_dir, args.channel) digest, caidx = create_casync_channel(target_dir, output_dir, args.channel)

@ -6,8 +6,8 @@ from openpilot.system.version import get_release_notes, get_version
CASYNC_ARGS = ["--with=symlinks", "--with=permissions"] CASYNC_ARGS = ["--with=symlinks", "--with=permissions"]
CHANNEL_MANIFEST_FILE = "channel.json" # file that contains details of the current release VERSION_METADATA_FILE = "version.json" # file that contains details of the current release
CASYNC_FILES = [CHANNEL_MANIFEST_FILE, ".caexclude"] CASYNC_FILES = [VERSION_METADATA_FILE, ".caexclude"]
def run(cmd): def run(cmd):
@ -38,7 +38,7 @@ def create_caexclude_file(path: pathlib.Path):
f.write(f"!{file}\n") f.write(f"!{file}\n")
def create_manifest(channel, version, release_notes): def create_version_metadata(channel, version, release_notes):
return { return {
"name": channel, "name": channel,
"openpilot": { "openpilot": {
@ -47,11 +47,11 @@ def create_manifest(channel, version, release_notes):
} }
} }
def create_manifest_file(path: pathlib.Path, channel: str): def create_version_metadata_file(path: pathlib.Path, channel: str):
version = get_version(str(path)) version = get_version(str(path))
release_notes = get_release_notes(str(path)) release_notes = get_release_notes(str(path))
with open(path / CHANNEL_MANIFEST_FILE, "w") as f: with open(path / VERSION_METADATA_FILE, "w") as f:
f.write(json.dumps(create_manifest(channel, version, release_notes))) f.write(json.dumps(create_version_metadata(channel, version, release_notes)))
def create_casync_channel(target_dir: pathlib.Path, output_dir: pathlib.Path, channel: str): def create_casync_channel(target_dir: pathlib.Path, output_dir: pathlib.Path, channel: str):

Loading…
Cancel
Save