main: add --output-dir option
This commit adds a new `--output-dir` option to override the default output directory for the generated artifacts. Note that this can also be used together with `manifest` when extra artifacts (like the sbom) is requested.
This commit is contained in:
parent
d485bc3a44
commit
cc2d1ac692
4 changed files with 94 additions and 7 deletions
|
|
@ -5,14 +5,15 @@ import (
|
|||
"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.
|
||||
func buildImage(res *imagefilter.Result, osbuildManifest []byte, osbuildStoreDir, outputDir string) error {
|
||||
// XXX: support output filename via commandline (c.f.
|
||||
// https://github.com/osbuild/images/pull/1039)
|
||||
jobOutputDir := outputDirFor(res)
|
||||
if outputDir == "" {
|
||||
outputDir = outputDirFor(res)
|
||||
}
|
||||
|
||||
// XXX: support stremaing via images/pkg/osbuild/monitor.go
|
||||
_, err := osbuild.RunOSBuild(osbuildManifest, osbuildStoreDir, jobOutputDir, res.ImgType.Exports(), nil, nil, false, osStderr)
|
||||
_, err := osbuild.RunOSBuild(osbuildManifest, osbuildStoreDir, outputDir, res.ImgType.Exports(), nil, nil, false, osStderr)
|
||||
return err
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue