Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support bundling only specific boards #166

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions tools/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from semver import Version
from marshmallow import fields
from enum import Enum as StrEnum
from argparse import ArgumentParser
from argparse import ArgumentParser, BooleanOptionalAction
import pathspec
import stat
import tarfile
Expand Down Expand Up @@ -231,13 +231,18 @@ def get_batch_timestamp():
iso=render_time.isoformat(),
)

def list_of_str(arg):
return arg.split(',')

def main():


arg_parser = ArgumentParser()

arg_parser.add_argument("--base-url", type=str, required=False, default=DEFAULT_DEPLOYMENT_BASE, help="Sets the download URL for the packages.")
arg_parser.add_argument("--debug", action="store_true", required=False, default=False, help="Creates a deployment for local development, hosted by localhost:8080")
arg_parser.add_argument("--examples", action=BooleanOptionalAction, required=False, default=True, help="Build the examples")
arg_parser.add_argument("--boards", type=list_of_str, help='list of boards to build', default=[])

cli_args = arg_parser.parse_args()

Expand Down Expand Up @@ -296,6 +301,13 @@ def main():
pkg_dict = json.loads(meta_path.read_bytes())
pkg = PackageConfigurationSchema.load(pkg_dict)

# Skip examples or non enabled boards
if any([
pkg.package_type == PackageType.example and not cli_args.examples,
pkg.package_type == PackageType.board_support and cli_args.boards and pkg.package_name not in cli_args.boards
]):
continue

pkg.version = version
pkg.created = batch_timestamp
pkg.package_dir = pkg_dir
Expand Down Expand Up @@ -517,4 +529,4 @@ def main():


if __name__ == "__main__":
main()
main()
Loading