diff --git a/examples/chef/chef.py b/examples/chef/chef.py index f44e23d5bb8df9..ef6077cb855776 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -24,6 +24,7 @@ import hashlib import json import subprocess +import tarfile import constants import stateful_shell @@ -197,7 +198,7 @@ def main(argv: Sequence[str]) -> None: print("Cached files out of date. Please run chef with the flag --generate_zzz and commit") exit(1) if device == "zap_commit" and False: - # Disabled for now + # Disabled for now, ci_manifest above created without include_zap_submod, fails in CI env. if cached_manifest[device] != ci_manifest[device]: print("ZAP updated in master, please pull master and run chef with the flag --generate_zzz and commit") exit(1) @@ -265,9 +266,18 @@ def main(argv: Sequence[str]) -> None: if device.endswith(target_file_ext): device_name = device[:-len(target_file_ext)] for platform, directory in platforms_and_outputs.items(): - platforms_and_outputs[platform] = os.path.join(_CHEF_SCRIPT_PATH, directory) + output_dir = os.path.join(_CHEF_SCRIPT_PATH, directory) command = './chef.py -czbr -d {} -t {}'.format(device_name, platform) subprocess.check_call(command, cwd=_CHEF_SCRIPT_PATH, shell=True) + archive_prefix = "/workspace/artifacts/" + if not os.path.exists(archive_prefix): + os.mkdir(archive_prefix) + archive_name = f"{platform}-chef-{device_name}-wifi-rpc" + archive_suffix = ".tar.gz" + archive_full_name = archive_prefix + archive_name + archive_suffix + print(f"Adding build output to archive {archive_full_name}") + with tarfile.open(archive_full_name, "w:gz") as tar: + tar.add(output_dir, arcname=".") exit(0) #