peach-package-builder/peach_package_builder/build_packages.py

33 lines
1.0 KiB
Python

import argparse
from peach_package_builder.build_rust_packages import build_rust_packages
def build_packages(default_branch=False, package=None):
"""
builds all PeachCloud microservices as .deb files and adds them to the freight repo
:param default_branch: checks out main git branch if True
:param package: if provided, only builds this package
"""
if package:
print("[ BUILDING ONLY {} ]".format(package))
build_rust_packages(default_branch=default_branch, package=package)
print("[ MICROSERVICE PACKAGE ARCHIVE UPDATED ]")
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument(
"-d",
"--default",
help="Ensure default branch for all repos for build",
action="store_true"
)
parser.add_argument(
"-p",
"--package",
help="Optionally specify package to build",
required=False,
default=None
)
args = parser.parse_args()
build_packages(default_branch=args.default, package=args.package)