Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1 from cpagravel/interop_testing_te9
Browse files Browse the repository at this point in the history
Cherry pick - Chef typo fix for bootstrap_zap on Linux and noip sample app
  • Loading branch information
andy31415 authored Jul 20, 2022
2 parents 8638802 + 4765de8 commit ff0436b
Show file tree
Hide file tree
Showing 14 changed files with 12,424 additions and 5 deletions.
25 changes: 22 additions & 3 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,16 @@ def main(argv: Sequence[str]) -> None:
dest="tty", metavar="TTY", default=None)
parser.add_option("", "--use_zzz", help="Use pre generated output from the ZAP tool found in the zzz_generated folder. Used to decrease execution time of CI/CD jobs",
dest="use_zzz", action="store_true")

# Build CD params.
parser.add_option("", "--build_all", help="For use in CD only. Builds and bundles all chef examples for the specified platform. Uses --use_zzz. Chef exits after completion.",
dest="build_all", action="store_true")
parser.add_option("", "--dry_run", help="Display list of target builds of the --build_all command without building them.",
dest="dry_run", action="store_true")
parser.add_option("", "--build_exclude", help="For use with --build_all. Build labels to exclude. Accepts a regex pattern. Mutually exclusive with --build_include.",
dest="build_exclude")
parser.add_option("", "--build_include", help="For use with --build_all. Build labels to include. Accepts a regex pattern. Mutually exclusive with --build_exclude.",
dest="build_include")
parser.add_option("-k", "--keep_going", help="For use in CD only. Continues building all sample apps in the event of an error.",
dest="keep_going", action="store_true")
parser.add_option(
Expand All @@ -341,7 +349,7 @@ def main(argv: Sequence[str]) -> None:
if sys.platform == "linux" or sys.platform == "linux2":
flush_print("Installing ZAP OS package dependencies")
install_deps_cmd = """\
sudo apt-get install node node-yargs npm
sudo apt-get install nodejs node-yargs npm
libpixman-1-dev libcairo2-dev libpango1.0-dev node-pre-gyp
libjpeg9-dev libgif-dev node-typescript"""
shell.run_cmd(unwrap_cmd(install_deps_cmd))
Expand Down Expand Up @@ -378,14 +386,25 @@ def main(argv: Sequence[str]) -> None:
#

if options.build_all:
if options.build_include and options.build_exclude:
flush_print(
"Error. --build_include and --build_exclude are mutually exclusive options.")
exit(1)
flush_print("Building all chef examples")
archive_prefix = "/workspace/artifacts/"
archive_suffix = ".tar.gz"
os.makedirs(archive_prefix, exist_ok=True)
failed_builds = []
for device_name in _DEVICE_LIST:
for platform, label_args in cicd_config["cd_platforms"].items():
for label, args in label_args.items():
archive_name = f"{label}-{device_name}"
if options.build_exclude and re.search(options.build_exclude, archive_name):
continue
elif options.build_include and not re.search(options.build_include, archive_name):
continue
if options.dry_run:
flush_print(archive_name)
continue
command = f"./chef.py -cbr --use_zzz -d {device_name} -t {platform} "
command += " ".join(args)
flush_print(f"Building {command}", with_border=True)
Expand All @@ -407,7 +426,7 @@ def main(argv: Sequence[str]) -> None:
if not options.keep_going:
exit(1)
continue
archive_name = f"{label}-{device_name}"
os.makedirs(archive_prefix, exist_ok=True)
archive_full_name = archive_prefix + archive_name + archive_suffix
flush_print(f"Adding build output to archive {archive_full_name}")
if os.path.exists(archive_full_name):
Expand Down
Loading

0 comments on commit ff0436b

Please sign in to comment.