mirror of
https://github.com/mudler/luet.git
synced 2025-08-08 02:44:43 +00:00
Add message asserting skip. Also return pointer to allow to edit Options
This commit is contained in:
parent
d23e1dee78
commit
d2abaa9cc1
@ -35,6 +35,7 @@ var buildCmd = &cobra.Command{
|
|||||||
Short: "build a package or a tree",
|
Short: "build a package or a tree",
|
||||||
Long: `build packages or trees from luet tree definitions. Packages are in [category]/[name]-[version] form`,
|
Long: `build packages or trees from luet tree definitions. Packages are in [category]/[name]-[version] form`,
|
||||||
PreRun: func(cmd *cobra.Command, args []string) {
|
PreRun: func(cmd *cobra.Command, args []string) {
|
||||||
|
viper.BindPFlag("clean", cmd.Flags().Lookup("clean"))
|
||||||
viper.BindPFlag("tree", cmd.Flags().Lookup("tree"))
|
viper.BindPFlag("tree", cmd.Flags().Lookup("tree"))
|
||||||
viper.BindPFlag("destination", cmd.Flags().Lookup("destination"))
|
viper.BindPFlag("destination", cmd.Flags().Lookup("destination"))
|
||||||
viper.BindPFlag("backend", cmd.Flags().Lookup("backend"))
|
viper.BindPFlag("backend", cmd.Flags().Lookup("backend"))
|
||||||
|
@ -44,7 +44,7 @@ type LuetCompiler struct {
|
|||||||
CompressionType CompressionImplementation
|
CompressionType CompressionImplementation
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLuetCompiler(backend CompilerBackend, db pkg.PackageDatabase, opt CompilerOptions) Compiler {
|
func NewLuetCompiler(backend CompilerBackend, db pkg.PackageDatabase, opt *CompilerOptions) Compiler {
|
||||||
// The CompilerRecipe will gives us a tree with only build deps listed.
|
// The CompilerRecipe will gives us a tree with only build deps listed.
|
||||||
return &LuetCompiler{
|
return &LuetCompiler{
|
||||||
Backend: backend,
|
Backend: backend,
|
||||||
@ -229,6 +229,7 @@ func (cs *LuetCompiler) stripIncludesFromRootfs(includes []string, rootfs string
|
|||||||
func (cs *LuetCompiler) compileWithImage(image, buildertaggedImage, packageImage string, concurrency int, keepPermissions, keepImg bool, p CompilationSpec) (Artifact, error) {
|
func (cs *LuetCompiler) compileWithImage(image, buildertaggedImage, packageImage string, concurrency int, keepPermissions, keepImg bool, p CompilationSpec) (Artifact, error) {
|
||||||
if !cs.Clean {
|
if !cs.Clean {
|
||||||
if art, err := LoadArtifactFromYaml(p); err == nil {
|
if art, err := LoadArtifactFromYaml(p); err == nil {
|
||||||
|
Debug("Artifact reloaded. Skipping build")
|
||||||
return art, err
|
return art, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -389,6 +390,7 @@ func (cs *LuetCompiler) compileWithImage(image, buildertaggedImage, packageImage
|
|||||||
func (cs *LuetCompiler) packageFromImage(p CompilationSpec, tag string, keepPermissions, keepImg bool, concurrency int) (Artifact, error) {
|
func (cs *LuetCompiler) packageFromImage(p CompilationSpec, tag string, keepPermissions, keepImg bool, concurrency int) (Artifact, error) {
|
||||||
if !cs.Clean {
|
if !cs.Clean {
|
||||||
if art, err := LoadArtifactFromYaml(p); err == nil {
|
if art, err := LoadArtifactFromYaml(p); err == nil {
|
||||||
|
Debug("Artifact reloaded. Skipping build")
|
||||||
return art, err
|
return art, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,8 @@ type CompilerOptions struct {
|
|||||||
Clean bool
|
Clean bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDefaultCompilerOptions() CompilerOptions {
|
func NewDefaultCompilerOptions() *CompilerOptions {
|
||||||
return CompilerOptions{
|
return &CompilerOptions{
|
||||||
ImageRepository: "luet/cache",
|
ImageRepository: "luet/cache",
|
||||||
PullFirst: true,
|
PullFirst: true,
|
||||||
CompressionType: None,
|
CompressionType: None,
|
||||||
|
Loading…
Reference in New Issue
Block a user