Example #1
0
def main() -> int:
    args = AssembleArgs()

    console.configure(level=args.logging_level)

    build_manifest = BuildManifest.from_file(args.manifest)
    build = build_manifest.build
    artifacts_dir = os.path.dirname(os.path.realpath(args.manifest.name))

    output_dir = AssembleOutputDir(build.filename).dir

    logging.info(f"Bundling {build.name} ({build.architecture}) on {build.platform} into {output_dir} ...")

    bundle_recorder = BundleRecorder(
        build,
        output_dir,
        artifacts_dir,
        BundleLocations.from_path(args.base_url, os.getcwd(), build.filename)
    )

    with Bundles.create(build_manifest, artifacts_dir, bundle_recorder, args.keep) as bundle:
        bundle.install_min()
        bundle.install_plugins()
        logging.info(f"Installed plugins: {bundle.installed_plugins}")

        #  Save a copy of the manifest inside of the tar
        bundle_recorder.write_manifest(bundle.min_dist.archive_path)
        bundle.package(output_dir)

        bundle_recorder.write_manifest(output_dir)

    logging.info("Done.")
    return 0
Example #2
0
 def test_base_url(self) -> None:
     self.assertEqual(AssembleArgs().base_url, "url")
Example #3
0
 def test_verbose_true(self) -> None:
     self.assertTrue(AssembleArgs().logging_level, logging.DEBUG)
Example #4
0
 def test_verbose_default(self) -> None:
     self.assertEqual(AssembleArgs().logging_level, logging.INFO)
Example #5
0
 def test_keep_true(self) -> None:
     self.assertTrue(AssembleArgs().keep)
Example #6
0
 def test_keep_default(self) -> None:
     self.assertFalse(AssembleArgs().keep)
Example #7
0
 def test_manifest(self) -> None:
     self.assertEqual(AssembleArgs().manifest.name,
                      TestAssembleArgs.OPENSEARCH_MANIFEST)