⚙️ Enhancements to final images building

This commit is multi-fold and impacts several areas:

- Don't re-generate final artifact locally if already present while
building with `requires_final_images`.
- Expose to CLI a way to build final images without pushing them.
- The packages listed with `requires_final_images` now are evaluated by
  the solver so the full deptree is took into account

Fixes: https://github.com/mudler/luet/issues/294
This commit is contained in:
Ettore Di Giacinto
2022-04-13 18:04:50 +02:00
parent 18881c3283
commit c6170fabd6
5 changed files with 251 additions and 48 deletions

View File

@@ -49,6 +49,9 @@ type Compiler struct {
// Tells wether to push final container images after building
PushFinalImages bool
PushFinalImagesForce bool
GenerateFinalImages bool
// Image repository to push to
PushFinalImagesRepository string
@@ -99,6 +102,11 @@ func WithFinalRepository(r string) func(cfg *Compiler) error {
}
}
func EnableGenerateFinalImages(cfg *Compiler) error {
cfg.GenerateFinalImages = true
return nil
}
func EnablePushFinalImages(cfg *Compiler) error {
cfg.PushFinalImages = true
return nil