Commit graph

16 commits

Author SHA1 Message Date
Michael Vogt
a11e124133 main: add new --extra-repo flag
This commit adds a  new flag `--extra-repo` that can be used
to point to a repository url that is added to the base
repositories when depsolving. Note that *no* gpg checking
will be performed for such repos as there is no way to
add gpg-keys (yet) via this mechanism.

This means that with a repo created with e.g. `createrepo_c` like
```console
$ mkdir repo
$ (cd repo && dnf download hello)
$ createrepo_c ./repo
```
and a blueprint like:
```toml
[[packages]]
name = "hello"
```
a manifest is generated that gets hello from this local repo:
```console
$ image-builder  --extra-repo file:$(pwd)/repo manifest qcow2 --distro centos-9 --blueprint ./bp.toml |jq|grep hello
          "path": "hello-2.12.1-5.fc41.x86_64.rpm",
```
Note that this is part of the base repositories so anything with a
higher version number will get pulled from the extra-repo, even
system libraries or kernels. Note also that this repository does
not become part of the image so after the image build all rpms
from there are not updated (unless of course the normal repos
have higher versions of them).

Note as well that there is no safeguard right now against adding
extra repos for the wrong version of the distro, i.e. one could
add an extra repo build against/for fedora-42 on a fedora-40 image
which most likely will break with bad depsolve errors. But that
is okay, this option is meant for advanced users and testing.
2025-02-12 12:57:21 +01:00
Michael Vogt
c78ea5f2b2 test: add test that checks that --progress works correctly
This commit checks that the `--progress` argument generates the
expected output, i.e. with `term` we will not get any osbuild
output and the spinner. And with `verbose` we will not get a
spinner and the osbuild output.
2025-01-29 15:21:33 +00:00
Michael Vogt
9a0f2ee7d7 test: copied build_fake_container_fixture() from bib
This is a very sad commit, it copies the code to make a fake
container with a faked osbuild.

The bright side is that the plan is to rewrite these helpers
in go and then we can just have a shared testutil module that
can be imported from both bib/ibcli.

And/or the two repos will merge and its just a (simple) test
helper. But I do not feel good (at all) about this.
2025-01-29 15:21:33 +00:00
Simon de Vlieger
a5f5b48293 test: write manifest in build
Having this test triggers the conditions for #94. This test case is
failing and the next commit fixes the bug.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-29 11:56:14 +00:00
Michael Vogt
98e4bebcfa image-builder: drop internal manifestgen in favor of images
This commit drops the internal `manifestgen` package in favor
of using the version in `images` now that
https://github.com/osbuild/images/pull/1153 is merged.
2025-01-27 10:14:53 +00:00
Simon de Vlieger
cfe8f7c289 test: switch to platform.machine
For some reason on a bunch of my systems `platform.processor()` always
returns an empty string. `platform.machine()` consistently works on
those systems.

This closes #95.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-27 08:32:33 +00:00
Simon de Vlieger
d1fe1f9df7 test: update container test args
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 15:42:21 +00:00
Simon de Vlieger
94afe7b150 test: use image-builder-test as a name
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-01-20 13:32:25 +00:00
Michael Vogt
d485bc3a44 ibcli: add new --extra-artifacts option with sbom support
This commit adds an option --extra-artifacts that can be
used to generate extra artifacts during the build or manifest
generation. Initially supported is `sbom` (but `manifest` is
planned too).

To use it run `--extra-artifacts=sbom` and it will generate
files like `centos-9-qcow2-x86_64.image-os.spdx.json` in
the output directory next to the generate runable artifact.

Closes: https://github.com/osbuild/image-builder-cli/issues/46
2025-01-19 21:57:14 +00:00
Michael Vogt
bdb32554ff test: add new test_container_builds_image_librepo test
This commit adds a (smoke) integration test for librepo based
manifests. It needs a flanking test that also ensures that
--use-librepo really generates librepo sources.
2025-01-17 13:29:01 +00:00
Michael Vogt
692a487fe9 test: fix integration test 2025-01-10 08:30:28 +00:00
Michael Vogt
80cadaf291 repos: lookup <buildin>, /{etc,usr/share}/image-builder/repositories
This commit switches the default repositories to use the build-in
ones from images PR#1112. It is still possible to override using
`/etc/image-builder` and `/usr/share/image-builder` or `--datadir`.

This is implicitly tested via the container test that no longer
includes the files from osbuild-composer in the container.
2025-01-09 16:17:50 +00:00
Florian Schüller
c408577b2d pre-commit: introduce make lint
Also make the linters part of the github actions.
2025-01-07 12:29:58 +00:00
Florian Schüller
734c132500 prepare all syntax for linters and spellchecks 2025-01-07 12:29:58 +00:00
Michael Vogt
083c220f0a test: move to centos-9 for the smoke test
This commit moves the smoke test from fedora-41 to centos-9. The
reason is that it seems the fedora mirrors in general are a bit
more flaky so /hopefully/ the centos one will help.

The real fix of course is to retry different mirrors on failure,
we will need to look into librepo integration in osbuild (again)
for this (hopefully soon!).
2024-12-19 11:33:13 +00:00
Michael Vogt
e7d8a39fcf test: add minimal test for container based building of images
This commit adds a smoke test that builds the ibcli container
and runs a fedora-41 raw-minimal build to double check that
the container based building actually works.

Thanks to Ondrej for suggesting this.
2024-12-19 08:49:26 +00:00