summaryrefslogtreecommitdiff
path: root/packages/aws-gateway-load-balancer-tunnel-handler/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/aws-gateway-load-balancer-tunnel-handler/build.py')
-rwxr-xr-xpackages/aws-gateway-load-balancer-tunnel-handler/build.py57
1 files changed, 0 insertions, 57 deletions
diff --git a/packages/aws-gateway-load-balancer-tunnel-handler/build.py b/packages/aws-gateway-load-balancer-tunnel-handler/build.py
deleted file mode 100755
index a8c75aab..00000000
--- a/packages/aws-gateway-load-balancer-tunnel-handler/build.py
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/env python3
-
-from argparse import ArgumentParser
-from pathlib import Path
-from subprocess import run
-
-
-def prepare_package() -> None:
- """Prepare a package
- """
- install_file = Path('./debian/install')
- install_data = 'obj-*-linux-gnu/gwlbtun usr/sbin'
- install_file.touch()
- install_file.write_text(install_data)
-
-
-def build_package(package_name: str, package_ver: str) -> bool:
- """Build a package using commands from external file
-
- Args:
- package_name (str): package name
- package_ver (str): package version
-
- Returns:
- bool: build status
- """
- # prepare sources
- debmake_cmd = [
- 'debmake', '-e', 'support@vyos.io', '-f', 'VyOS Support', '-p',
- package_name, '-u', package_ver, '-t'
- ]
- run(debmake_cmd)
-
- prepare_package()
-
- # build a package
- run('debuild')
-
- return True
-
-
-# build a package
-if __name__ == '__main__':
- # prepare argument parser
- arg_parser = ArgumentParser()
- arg_parser.add_argument('--package',
- required=True,
- help='Package name to build')
- arg_parser.add_argument('--version',
- required=True,
- help='Version for the package')
- args = arg_parser.parse_args()
-
- if not build_package(args.package, args.version):
- exit(1)
-
- exit()