]> git.ipfire.org Git - pakfire.git/commitdiff
client: Add switch to disable test builds
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 May 2023 07:43:14 +0000 (07:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 5 May 2023 07:43:14 +0000 (07:43 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/hub.py
src/scripts/pakfire-client.in

index cc519f919de229ab2b09555b325d782ee3f6bfbf..00df9401b1bd145d45fbe50e3133c7b53e3de137 100644 (file)
@@ -248,7 +248,8 @@ class Hub(object):
        def get_build(self, uuid):
                return self._request("/api/v1/builds/%s" % uuid, decode="json")
 
-       async def build(self, path, repo=None, arches=None):
+       async def build(self, path, repo=None, arches=None,
+                       disable_test_builds=False):
                """
                        Create a new build on the hub
                """
@@ -259,7 +260,11 @@ class Hub(object):
 
                # Create a new build
                build_id = await self._request("POST", "/api/v1/builds",
-                       upload_id=upload_id, repo=repo, arches=arches)
+                       upload_id=upload_id,
+                       repo=repo,
+                       arches=arches,
+                       disable_test_builds=disable_test_builds,
+               )
 
                log.debug("Build creates as %s" % build_id)
 
index 2441d1b26953ff97e544d50d19be85cd066869cd..0df520205a3d65831120adf07c0d309d4345c5b7 100644 (file)
@@ -49,6 +49,8 @@ class Cli(object):
                        help=_("Build the package(s) for the given architecture only"))
                build.add_argument("--repo",
                        help=_("Create the build in this repository"))
+               build.add_argument("--disable-test-builds", action="store_true",
+                       help=_("No test builds will be created for this build"))
                build.set_defaults(func=self._build)
 
                # check-connection
@@ -129,7 +131,8 @@ class Cli(object):
 
                        # Build all packages
                        for package in ns.packages:
-                               await hub.build(package, arches=ns.arch, repo=ns.repo)
+                               await hub.build(package, arches=ns.arch, repo=ns.repo,
+                                       disable_test_builds=ns.disable_test_builds)
 
                finally:
                        tmp.cleanup()