main: add upload support directly to build

This commit adds support to upload the build image directly to
the target cloud. Currently only ami/AWS is supported.

If the cloud specific configuration is given at the commandline
and the image type is a cloud image the cloud upload will happen
automatically (just like with bib). Incomplete upload config is
an error.
This commit is contained in:
Michael Vogt 2025-02-03 21:41:53 +01:00
parent e41377b82a
commit 25f21a3205
7 changed files with 437 additions and 133 deletions

View file

@ -21,11 +21,6 @@ func buildImage(pbar progress.ProgressBar, res *imagefilter.Result, osbuildManif
opts = &buildOptions{}
}
// XXX: support output filename via commandline (c.f.
// https://github.com/osbuild/images/pull/1039)
if opts.OutputDir == "" {
opts.OutputDir = outputNameFor(res)
}
if opts.WriteManifest {
p := filepath.Join(opts.OutputDir, fmt.Sprintf("%s.osbuild-manifest.json", outputNameFor(res)))
if err := os.MkdirAll(filepath.Dir(p), 0755); err != nil {