Commit graph

13 commits

Author SHA1 Message Date
Michael Vogt
830528fa15 cmd: implement manifest command
This commit implements the `manifest` command for `image-builder`.
It will generate an osbuild manifest based on the given inputs,
e.g.:
```
$ ./image-builder manifest centos-9 qcow2
{"version":"2","pipelines":[{"name":"build","runner":",...
```

Note that there is an integration test but because of the depsolve
it will be slow. It will be skipped when doing `go test -short`.
2024-12-16 07:54:45 +00:00
Michael Vogt
ea61ef593f pkg: add new manifestgen package
This commit adds a new generic `manifestgen` package that can be
used to generate osbuild manifests. It works on a higher level
then the low-level `manifest` package from `images` and provides
plugable resolvers and a streamlined API.

This package is meant to be moved to the `images` library eventually.
2024-12-16 07:54:45 +00:00
Michael Vogt
5a6ee5c1ca pkg: add new manifesttest package with test helpers
This commit adds a new `manifesttest` that helps sharing code
when testing generated osbuild manifests.
2024-12-16 07:54:45 +00:00
Michael Vogt
8ae5b98d9d HACKING.md: add basic documentation for the development
This commit adds a basic HACKING.md that explains the bare mimimum
to get started, including `go test -short` to skip the expensive
tests.

Contains also a drive-by rename of the test dependency install
for the GH action.
2024-12-16 07:54:45 +00:00
Michael Vogt
e9e8dc5256 filters: add new getOneImage() helper for manifest/build
This commit adds a helper to find exactly a single image from a
given disto/type/arch description. This will be used in `manifest`,
`build` and potentially more. It is meant to support copy/paste
from the `image-builder list-images` output, so: "distro:centos-9"
is support just like "centos-9" (same for distro/imgType/arch).
2024-12-16 07:54:45 +00:00
Florian Schüller
7f9936acc9 go.mod: upgrade golang.org/x/crypto
Upgrade golang.org/x/crypto due to
https://github.com/osbuild/image-builder-cli/security/dependabot/1
2024-12-12 18:48:50 +00:00
Michael Vogt
6d978ddc20 main: list-images takes no args (just --filter)
Tiny commit to error if extra arguments are passed to list-images.
Only `--filter` is supported there currently.
2024-12-03 13:12:22 +00:00
Michael Vogt
99bd43e7d4 README: document install, prerequists and list-images
This commit adds some examples and how to use to the README.
2024-11-29 10:52:28 +00:00
Michael Vogt
2719f3f727 list-images: add --datadir override for e.g. custom repositories
This commit adds a `--datadir` override that allows overriding
the default search paths for e.g. the custom repositories. In
practise only repository overrides are supported because that
is the only data stored there.
2024-11-29 08:30:30 +00:00
Michael Vogt
56f9c6969c workflow: update to work with the images dependencies
This commit updates the GH workflow file to install the required
dependencies to build the images library.
2024-11-28 09:53:08 +00:00
Michael Vogt
7a838332c8 main: initial version of image-builder with basic --list-images
This commit adds the new `image-builder` binary. This binary is
meant to build images from the CLI without the need to setup a
daemon. The main use-case is CI/CD and admins running this in
scripts or ad-hoc. The CLI should be pleasant to use.

This first commit adds the `list-images` command which is a thin
wrapper around functionality from the `osbuild/images` library.

It will list all buildable images by default and can be trimmed
down further via `--filter` which supports the filtering from
the `images` library, see https://github.com/osbuild/images/pull/1015

It also supports `--output` which will output the result in the
given format. Currently "text" and "json" are supported.

Note that this will not work on it's own yet, it will need an
installed image-builder to get the repositories. This will need
to get fixed via either:
1. a dependency package for `ibuilder` that carries all the repos
2. a shared repo that contains the repos
3. using go:embed to get them (see images#1038)
2024-11-28 09:53:08 +00:00
Michael Vogt
12d60a9c74
workflow: add trivial go workflow based on default template 2024-11-18 10:26:22 +01:00
Michael Vogt
c718759dea README.md: initial draft 2024-11-12 09:47:16 +01:00