[libvirt PATCH 25/33] ci: helper: Add a job argparse subparser

Erik Skultety posted 33 patches 2 years, 5 months ago
There is a newer version of this series
[libvirt PATCH 25/33] ci: helper: Add a job argparse subparser
Posted by Erik Skultety 2 years, 5 months ago
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>
---
 ci/helper | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/ci/helper b/ci/helper
index 75552774f6..60fdaed5f4 100755
--- a/ci/helper
+++ b/ci/helper
@@ -114,6 +114,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",
-- 
2.41.0
Re: [libvirt PATCH 25/33] ci: helper: Add a job argparse subparser
Posted by Daniel P. Berrangé 2 years, 5 months ago
On Fri, Aug 25, 2023 at 07:55:33PM +0200, Erik Skultety wrote:
> 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>
> ---
>  ci/helper | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|