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
18 lines
600 B
Go
18 lines
600 B
Go
package main
|
|
|
|
import (
|
|
"github.com/osbuild/images/pkg/imagefilter"
|
|
"github.com/osbuild/images/pkg/osbuild"
|
|
)
|
|
|
|
func buildImage(res *imagefilter.Result, osbuildManifest []byte, osbuildStoreDir string) error {
|
|
// XXX: support output dir via commandline
|
|
// XXX2: support output filename via commandline (c.f.
|
|
// https://github.com/osbuild/images/pull/1039)
|
|
jobOutputDir := outputDirFor(res)
|
|
|
|
// XXX: support stremaing via images/pkg/osbuild/monitor.go
|
|
_, err := osbuild.RunOSBuild(osbuildManifest, osbuildStoreDir, jobOutputDir, res.ImgType.Exports(), nil, nil, false, osStderr)
|
|
return err
|
|
|
|
}
|