mirror of
https://github.com/mudler/luet.git
synced 2025-09-02 07:45:02 +00:00
cmd/build: Add support for multiple trees
This commit is contained in:
23
cmd/build.go
23
cmd/build.go
@@ -62,7 +62,7 @@ var buildCmd = &cobra.Command{
|
|||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
|
||||||
clean := viper.GetBool("clean")
|
clean := viper.GetBool("clean")
|
||||||
src := viper.GetString("tree")
|
treePaths := viper.GetStringSlice("tree")
|
||||||
dst := viper.GetString("destination")
|
dst := viper.GetString("destination")
|
||||||
concurrency := LuetCfg.GetGeneral().Concurrency
|
concurrency := LuetCfg.GetGeneral().Concurrency
|
||||||
backendType := viper.GetString("backend")
|
backendType := viper.GetString("backend")
|
||||||
@@ -105,14 +105,21 @@ var buildCmd = &cobra.Command{
|
|||||||
|
|
||||||
generalRecipe := tree.NewCompilerRecipe(db)
|
generalRecipe := tree.NewCompilerRecipe(db)
|
||||||
|
|
||||||
Info("Loading", src)
|
if len(treePaths) <= 0 {
|
||||||
Info("Building in", dst)
|
Fatal("No tree path supplied!")
|
||||||
|
|
||||||
err := generalRecipe.Load(src)
|
|
||||||
if err != nil {
|
|
||||||
Fatal("Error: " + err.Error())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, src := range treePaths {
|
||||||
|
Info("Loading tree", src)
|
||||||
|
|
||||||
|
err := generalRecipe.Load(src)
|
||||||
|
if err != nil {
|
||||||
|
Fatal("Error: " + err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Info("Building in", dst)
|
||||||
|
|
||||||
stype := LuetCfg.Viper.GetString("solver.type")
|
stype := LuetCfg.Viper.GetString("solver.type")
|
||||||
discount := LuetCfg.Viper.GetFloat64("solver.discount")
|
discount := LuetCfg.Viper.GetFloat64("solver.discount")
|
||||||
rate := LuetCfg.Viper.GetFloat64("solver.rate")
|
rate := LuetCfg.Viper.GetFloat64("solver.rate")
|
||||||
@@ -196,7 +203,7 @@ func init() {
|
|||||||
Fatal(err)
|
Fatal(err)
|
||||||
}
|
}
|
||||||
buildCmd.Flags().Bool("clean", true, "Build all packages without considering the packages present in the build directory")
|
buildCmd.Flags().Bool("clean", true, "Build all packages without considering the packages present in the build directory")
|
||||||
buildCmd.Flags().String("tree", path, "Source luet tree")
|
buildCmd.Flags().StringSliceP("tree", "t", []string{}, "Path of the tree to use.")
|
||||||
buildCmd.Flags().String("backend", "docker", "backend used (docker,img)")
|
buildCmd.Flags().String("backend", "docker", "backend used (docker,img)")
|
||||||
buildCmd.Flags().Bool("privileged", false, "Privileged (Keep permissions)")
|
buildCmd.Flags().Bool("privileged", false, "Privileged (Keep permissions)")
|
||||||
buildCmd.Flags().String("database", "memory", "database used for solving (memory,boltdb)")
|
buildCmd.Flags().String("database", "memory", "database used for solving (memory,boltdb)")
|
||||||
|
Reference in New Issue
Block a user