🚀 CLI Integration Complete: debos Backend Now Available

This commit completes the CLI integration for the debos backend:

 IMPLEMENTED:
- New debos build path accessible via --use-debos flag
- Full CLI compatibility with existing bootc-image-builder interface
- Automatic fallback to osbuild when --use-debos not specified
- Comprehensive debos-specific command line options

🔧 NEW FLAGS:
- --use-debos: Enable debos backend instead of osbuild
- --debos-suite: Override Debian suite detection
- --debos-packages: Additional packages to install
- --debos-ostree: Enable/disable OSTree integration
- --debos-repository: OSTree repository path
- --debos-branch: OSTree branch name
- --debos-dry-run: Perform dry run without building

🧪 TESTING:
- All tests passing with comprehensive test script
- Dry-run functionality working correctly
- Suite and architecture detection functional
- Help output properly displays all debos options

🎯 USAGE EXAMPLES:
- Basic: ./bootc-image-builder --use-debos debian:trixie
- Custom suite: --use-debos --debos-suite bookworm debian:bookworm
- Dry run: --use-debos --debos-dry-run debian:trixie

The debos backend is now fully integrated and ready for end-to-end testing!
This commit is contained in:
robojerk 2025-08-11 13:38:27 -07:00
parent 26c1a99ea1
commit 1acdcdfd57
4 changed files with 394 additions and 4 deletions

View file

@ -416,6 +416,12 @@ func cmdBuild(cmd *cobra.Command, args []string) error {
outputDir, _ := cmd.Flags().GetString("output")
targetArch, _ := cmd.Flags().GetString("target-arch")
progressType, _ := cmd.Flags().GetString("progress")
useDebos, _ := cmd.Flags().GetBool("use-debos")
// If --use-debos is specified, use the debos backend
if useDebos {
return cmdBuildDebos(cmd, args)
}
logrus.Debug("Validating environment")
if err := setup.Validate(targetArch); err != nil {
@ -627,7 +633,9 @@ func buildCobraCmdline() (*cobra.Command, error) {
rootCmd := &cobra.Command{
Use: "bootc-image-builder",
Long: "Create a bootable image from an ostree native container",
Long: "Create a bootable image from an ostree native container\n\n" +
"Supports both osbuild (default) and debos backends.\n" +
"Use --use-debos to enable the debos backend for Debian-based images.",
PersistentPreRunE: rootPreRunE,
SilenceErrors: true,
Version: version,
@ -639,8 +647,10 @@ func buildCobraCmdline() (*cobra.Command, error) {
buildCmd := &cobra.Command{
Use: "build IMAGE_NAME",
Short: rootCmd.Long + " (default command)",
Long: rootCmd.Long + "\n" +
Short: "Create a bootable image from a container (default command)",
Long: "Create a bootable image from a container image.\n\n" +
"Supports both osbuild (default) and debos backends.\n" +
"Use --use-debos to enable the debos backend for Debian-based images.\n\n" +
"(default action if no command is given)\n" +
"IMAGE_NAME: container image to build into a bootable image",
Args: cobra.ExactArgs(1),
@ -648,7 +658,9 @@ func buildCobraCmdline() (*cobra.Command, error) {
RunE: cmdBuild,
SilenceUsage: true,
Example: rootCmd.Use + " build quay.io/debian-bootc/debian-bootc:bookworm\n" +
rootCmd.Use + " quay.io/debian-bootc/debian-bootc:bookworm\n",
rootCmd.Use + " quay.io/debian-bootc/debian-bootc:bookworm\n" +
rootCmd.Use + " build --use-debos debian:trixie\n" +
rootCmd.Use + " --use-debos --debos-suite bookworm debian:bookworm\n",
Version: rootCmd.Version,
}
buildCmd.SetVersionTemplate(version)
@ -710,6 +722,16 @@ func buildCobraCmdline() (*cobra.Command, error) {
buildCmd.Flags().String("store", "/store", "osbuild store for intermediate pipeline trees")
//TODO: add json progress for higher level tools like "podman bootc"
buildCmd.Flags().String("progress", "auto", "type of progress bar to use (e.g. verbose,term)")
// Add debos-specific flags
buildCmd.Flags().Bool("use-debos", false, "Use debos backend instead of osbuild")
buildCmd.Flags().String("debos-suite", "", "Override Debian suite detection (e.g., bookworm, trixie)")
buildCmd.Flags().StringArray("debos-packages", []string{}, "Additional packages to install during debos build")
buildCmd.Flags().Bool("debos-ostree", true, "Enable OSTree integration for bootc compatibility")
buildCmd.Flags().String("debos-repository", "/ostree/repo", "OSTree repository path")
buildCmd.Flags().String("debos-branch", "", "OSTree branch name (auto-generated if not specified)")
buildCmd.Flags().Bool("debos-dry-run", false, "Perform a dry run without building (debos --dry-run)")
// flag rules
for _, dname := range []string{"output", "store", "rpmmd"} {
if err := buildCmd.MarkFlagDirname(dname); err != nil {