cmd: add blueprint support to manifest
This commit adds support to pass a blueprint to the manifest generation.
This commit is contained in:
parent
f242005672
commit
05ef9502e4
2 changed files with 38 additions and 5 deletions
|
|
@ -9,8 +9,8 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/osbuild/images/pkg/arch"
|
||||
"github.com/osbuild/images/pkg/blueprint"
|
||||
|
||||
"github.com/osbuild/image-builder-cli/internal/blueprintload"
|
||||
"github.com/osbuild/image-builder-cli/internal/manifestgen"
|
||||
)
|
||||
|
||||
|
|
@ -41,6 +41,10 @@ func cmdManifest(cmd *cobra.Command, args []string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
blueprintPath, err := cmd.Flags().GetString("blueprint")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
distroStr := args[0]
|
||||
imgTypeStr := args[1]
|
||||
|
|
@ -65,8 +69,12 @@ func cmdManifest(cmd *cobra.Command, args []string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
var bp blueprint.Blueprint
|
||||
return mg.Generate(&bp, res.Distro, res.ImgType, res.Arch, nil)
|
||||
bp, err := blueprintload.Load(blueprintPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return mg.Generate(bp, res.Distro, res.ImgType, res.Arch, nil)
|
||||
}
|
||||
|
||||
func run() error {
|
||||
|
|
@ -107,7 +115,8 @@ operating sytsems like centos and RHEL with easy customizations support.`,
|
|||
Args: cobra.MinimumNArgs(2),
|
||||
Hidden: true,
|
||||
}
|
||||
// XXX: add blueprint switch
|
||||
// XXX: share with build
|
||||
manifestCmd.Flags().String("blueprint", "", `pass a blueprint file`)
|
||||
rootCmd.AddCommand(manifestCmd)
|
||||
|
||||
return rootCmd.Execute()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue