Skip to content

Commit

Permalink
Chef - Continue instead of breaking on build error (#19988)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpagravel authored and pull[bot] committed Jan 16, 2024
1 parent 92dce9e commit 6013644
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ def main(argv: Sequence[str]) -> None:
dest="use_zzz", action="store_true")
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("-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(
"", "--ci", help="Builds Chef examples defined in cicd_config. Uses --use_zzz. Uses specified target from -t. Chef exits after completion.", dest="ci", action="store_true")

Expand Down Expand Up @@ -387,13 +389,17 @@ def main(argv: Sequence[str]) -> None:
except RuntimeError as build_fail_error:
failed_builds.append((device_name, platform, "build"))
flush_print(str(build_fail_error))
break
if not options.keep_going:
exit(1)
continue
try:
bundle(platform, device_name)
except FileNotFoundError as bundle_fail_error:
failed_builds.append((device_name, platform, "bundle"))
flush_print(str(bundle_fail_error))
break
if not options.keep_going:
exit(1)
continue
archive_name = f"{label}-{device_name}"
archive_full_name = archive_prefix + archive_name + archive_suffix
flush_print(f"Adding build output to archive {archive_full_name}")
Expand Down
2 changes: 1 addition & 1 deletion integrations/cloudbuild/chef.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ steps:
- PW_ENVIRONMENT_ROOT=/pwenv
args:
- >-
./examples/chef/chef.py --build_all
./examples/chef/chef.py --build_all --keep_going
id: CompileAll
waitFor:
- Bootstrap
Expand Down

0 comments on commit 6013644

Please sign in to comment.