mirror of
https://github.com/mudler/luet.git
synced 2025-09-04 00:34:41 +00:00
Add --values flag also to luet tree images
This commit is contained in:
@@ -75,7 +75,7 @@ Build packages specifying multiple definition trees:
|
|||||||
viper.BindPFlag("compression", cmd.Flags().Lookup("compression"))
|
viper.BindPFlag("compression", cmd.Flags().Lookup("compression"))
|
||||||
viper.BindPFlag("nodeps", cmd.Flags().Lookup("nodeps"))
|
viper.BindPFlag("nodeps", cmd.Flags().Lookup("nodeps"))
|
||||||
viper.BindPFlag("onlydeps", cmd.Flags().Lookup("onlydeps"))
|
viper.BindPFlag("onlydeps", cmd.Flags().Lookup("onlydeps"))
|
||||||
viper.BindPFlag("values", cmd.Flags().Lookup("values"))
|
util.BindValuesFlags(cmd)
|
||||||
viper.BindPFlag("backend-args", cmd.Flags().Lookup("backend-args"))
|
viper.BindPFlag("backend-args", cmd.Flags().Lookup("backend-args"))
|
||||||
|
|
||||||
viper.BindPFlag("image-repository", cmd.Flags().Lookup("image-repository"))
|
viper.BindPFlag("image-repository", cmd.Flags().Lookup("image-repository"))
|
||||||
@@ -101,7 +101,7 @@ Build packages specifying multiple definition trees:
|
|||||||
all := viper.GetBool("all")
|
all := viper.GetBool("all")
|
||||||
compressionType := viper.GetString("compression")
|
compressionType := viper.GetString("compression")
|
||||||
imageRepository := viper.GetString("image-repository")
|
imageRepository := viper.GetString("image-repository")
|
||||||
values := viper.GetStringSlice("values")
|
values := util.ValuesFlags()
|
||||||
wait := viper.GetBool("wait")
|
wait := viper.GetBool("wait")
|
||||||
push := viper.GetBool("push")
|
push := viper.GetBool("push")
|
||||||
pull := viper.GetBool("pull")
|
pull := viper.GetBool("pull")
|
||||||
|
@@ -23,6 +23,7 @@ import (
|
|||||||
//. "github.com/mudler/luet/pkg/config"
|
//. "github.com/mudler/luet/pkg/config"
|
||||||
"github.com/ghodss/yaml"
|
"github.com/ghodss/yaml"
|
||||||
helpers "github.com/mudler/luet/cmd/helpers"
|
helpers "github.com/mudler/luet/cmd/helpers"
|
||||||
|
"github.com/mudler/luet/cmd/util"
|
||||||
"github.com/mudler/luet/pkg/compiler"
|
"github.com/mudler/luet/pkg/compiler"
|
||||||
"github.com/mudler/luet/pkg/compiler/backend"
|
"github.com/mudler/luet/pkg/compiler/backend"
|
||||||
"github.com/mudler/luet/pkg/compiler/types/options"
|
"github.com/mudler/luet/pkg/compiler/types/options"
|
||||||
@@ -50,6 +51,7 @@ func NewTreeImageCommand() *cobra.Command {
|
|||||||
if len(args) != 1 {
|
if len(args) != 1 {
|
||||||
Fatal("Expects one package as parameter")
|
Fatal("Expects one package as parameter")
|
||||||
}
|
}
|
||||||
|
util.BindValuesFlags(cmd)
|
||||||
viper.BindPFlag("image-repository", cmd.Flags().Lookup("image-repository"))
|
viper.BindPFlag("image-repository", cmd.Flags().Lookup("image-repository"))
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -59,6 +61,7 @@ func NewTreeImageCommand() *cobra.Command {
|
|||||||
treePath, _ := cmd.Flags().GetStringArray("tree")
|
treePath, _ := cmd.Flags().GetStringArray("tree")
|
||||||
imageRepository := viper.GetString("image-repository")
|
imageRepository := viper.GetString("image-repository")
|
||||||
pullRepo, _ := cmd.Flags().GetStringArray("pull-repository")
|
pullRepo, _ := cmd.Flags().GetStringArray("pull-repository")
|
||||||
|
values := util.ValuesFlags()
|
||||||
|
|
||||||
out, _ := cmd.Flags().GetString("output")
|
out, _ := cmd.Flags().GetString("output")
|
||||||
if out != "terminal" {
|
if out != "terminal" {
|
||||||
@@ -80,6 +83,7 @@ func NewTreeImageCommand() *cobra.Command {
|
|||||||
luetCompiler := compiler.NewLuetCompiler(
|
luetCompiler := compiler.NewLuetCompiler(
|
||||||
compilerBackend,
|
compilerBackend,
|
||||||
reciper.GetDatabase(),
|
reciper.GetDatabase(),
|
||||||
|
options.WithBuildValues(values),
|
||||||
options.WithPushRepository(imageRepository),
|
options.WithPushRepository(imageRepository),
|
||||||
options.WithPullRepositories(pullRepo),
|
options.WithPullRepositories(pullRepo),
|
||||||
options.WithSolverOptions(opts),
|
options.WithSolverOptions(opts),
|
||||||
|
@@ -17,6 +17,7 @@ package util
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
|
"github.com/spf13/viper"
|
||||||
|
|
||||||
"github.com/mudler/luet/pkg/config"
|
"github.com/mudler/luet/pkg/config"
|
||||||
. "github.com/mudler/luet/pkg/config"
|
. "github.com/mudler/luet/pkg/config"
|
||||||
@@ -35,6 +36,14 @@ func BindSolverFlags(cmd *cobra.Command) {
|
|||||||
LuetCfg.Viper.BindPFlag("solver.max_attempts", cmd.Flags().Lookup("solver-attempts"))
|
LuetCfg.Viper.BindPFlag("solver.max_attempts", cmd.Flags().Lookup("solver-attempts"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BindValuesFlags(cmd *cobra.Command) {
|
||||||
|
viper.BindPFlag("values", cmd.Flags().Lookup("values"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func ValuesFlags() []string {
|
||||||
|
return viper.GetStringSlice("values")
|
||||||
|
}
|
||||||
|
|
||||||
func SetSystemConfig() {
|
func SetSystemConfig() {
|
||||||
dbpath := LuetCfg.Viper.GetString("system.database_path")
|
dbpath := LuetCfg.Viper.GetString("system.database_path")
|
||||||
rootfs := LuetCfg.Viper.GetString("system.rootfs")
|
rootfs := LuetCfg.Viper.GetString("system.rootfs")
|
||||||
|
Reference in New Issue
Block a user