From f0a7b2261e0610cbfe23c72e56023cf98040fe29 Mon Sep 17 00:00:00 2001 From: Lars Karlitski Date: Sun, 1 Dec 2019 21:53:00 +0100 Subject: [PATCH] pipeline: introduce host runner osbuild currently throws an error when not passing a build environment on the command line, because the runner is unset. This is annoying on hosts which only need a runner set, but no build pipeline. To simplify running osbuild in this common case, introduce `org.osbuild.host`, which is a runner that is defined to work on the host that osbuild is installed on. Use this runner by default and include a symlink to the right runner in the Fedora and RHEL packages. Also add `runners/org.osbuild.host` to `.gitignore`, so that developers can set the symlink when running osbuild from the source directory. Fixes #171 --- .gitignore | 2 ++ osbuild.spec | 8 ++++++++ osbuild/pipeline.py | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 84c9d9d2..b3dd45a1 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ __pycache__ /output-test /test/.vagrant + +/runners/org.osbuild.host diff --git a/osbuild.spec b/osbuild.spec index 31d3bb16..293434db 100644 --- a/osbuild.spec +++ b/osbuild.spec @@ -61,6 +61,14 @@ install -p -m 0755 $(find runners -type f) %{buildroot}%{pkgdir}/runners mkdir -p %{buildroot}%{pkgdir}/stages/osbuild mkdir -p %{buildroot}%{pkgdir}/assemblers/osbuild +# install host runner +%if 0%{?fc30} +ln -s org.osbuild.fedora30 %{buildroot}%{pkgdir}/runners/org.osbuild.host +%endif +%if 0%{?el8} +ln -s org.osbuild.rhel82 %{buildroot}%{pkgdir}/runners/org.osbuild.host +%endif + %check exit 0 # We have some integration tests, but those require running a VM, so that would diff --git a/osbuild/pipeline.py b/osbuild/pipeline.py index 7e223382..6f2aff38 100644 --- a/osbuild/pipeline.py +++ b/osbuild/pipeline.py @@ -270,7 +270,7 @@ def load(description): if build: build_pipeline, runner = load_build(build) else: - build_pipeline, runner = None, None + build_pipeline, runner = None, "org.osbuild.host" pipeline = Pipeline(runner, build_pipeline)