]> xenbits.xensource.com Git - libvirt.git/commitdiff
ci: helper: Add a job argparse subparser
authorErik Skultety <eskultet@redhat.com>
Thu, 24 Aug 2023 09:07:09 +0000 (11:07 +0200)
committerErik Skultety <eskultet@redhat.com>
Tue, 12 Sep 2023 09:36:03 +0000 (11:36 +0200)
The idea behind this subcommand is to follow whatever build job we have
defined in the GitLab CI pipeline, so that we only have a single source
of truth for the recipes. Adds 'shell' as an extra option for
interactive container build debugging.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
ci/helper

index f7b0204ea072c33404c17fcae48f4079d928426e..bc5de008b218fea8a99753b75e7e6e9d8059e59d 100755 (executable)
--- a/ci/helper
+++ b/ci/helper
@@ -139,6 +139,21 @@ class Parser:
         )
         shellparser.set_defaults(func=Application._action_shell)
 
+        jobparser = subparsers.add_parser(
+            "run",
+            help="Run a GitLab CI job or 'shell' in a local environment",
+            parents=[containerparser],
+            formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+        )
+        jobparser.add_argument(
+            "--job",
+            choices=["build", "codestyle", "potfile", "rpmbuild",
+                     "shell", "test", "website"],
+            default="build",
+            help="Run a GitLab CI job or 'shell' in a local environment",
+        )
+        jobparser.set_defaults(func=Application._action_run)
+
         # list-images action
         listimagesparser = subparsers.add_parser(
             "list-images",