mirror of
https://github.com/mudler/luet.git
synced 2025-09-03 00:06:36 +00:00
Add unicode icons
This commit is contained in:
@@ -44,10 +44,10 @@ func (*SimpleDocker) BuildImage(opts compiler.CompilerBackendOptions) error {
|
|||||||
path := opts.SourcePath
|
path := opts.SourcePath
|
||||||
dockerfileName := opts.DockerFileName
|
dockerfileName := opts.DockerFileName
|
||||||
buildarg := []string{"build", "-f", dockerfileName, "-t", name, "."}
|
buildarg := []string{"build", "-f", dockerfileName, "-t", name, "."}
|
||||||
Spinner(22)
|
Spinner(24)
|
||||||
defer SpinnerStop()
|
defer SpinnerStop()
|
||||||
|
|
||||||
Debug("Building image "+name+" - running docker with: ", buildarg)
|
Debug(" 🐋 Building image "+name+" - running docker with: ", buildarg)
|
||||||
cmd := exec.Command("docker", buildarg...)
|
cmd := exec.Command("docker", buildarg...)
|
||||||
cmd.Dir = path
|
cmd.Dir = path
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
@@ -59,10 +59,10 @@ func (*SimpleDocker) BuildImage(opts compiler.CompilerBackendOptions) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (*SimpleDocker) CopyImage(src, dst string) error {
|
func (*SimpleDocker) CopyImage(src, dst string) error {
|
||||||
Spinner(22)
|
Spinner(24)
|
||||||
defer SpinnerStop()
|
defer SpinnerStop()
|
||||||
|
|
||||||
Debug("Tagging image - running docker with: ", src, dst)
|
Debug(" 🐋 Tagging image - running docker with: ", src, dst)
|
||||||
cmd := exec.Command("docker", "tag", src, dst)
|
cmd := exec.Command("docker", "tag", src, dst)
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -75,10 +75,10 @@ func (*SimpleDocker) CopyImage(src, dst string) error {
|
|||||||
func (*SimpleDocker) DownloadImage(opts compiler.CompilerBackendOptions) error {
|
func (*SimpleDocker) DownloadImage(opts compiler.CompilerBackendOptions) error {
|
||||||
name := opts.ImageName
|
name := opts.ImageName
|
||||||
buildarg := []string{"pull", name}
|
buildarg := []string{"pull", name}
|
||||||
Spinner(22)
|
Spinner(24)
|
||||||
defer SpinnerStop()
|
defer SpinnerStop()
|
||||||
|
|
||||||
Debug("Downloading image "+name+" - running docker with: ", buildarg)
|
Debug(" 🐋 Downloading image "+name+" - running docker with: ", buildarg)
|
||||||
cmd := exec.Command("docker", buildarg...)
|
cmd := exec.Command("docker", buildarg...)
|
||||||
out, err := cmd.CombinedOutput()
|
out, err := cmd.CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -91,7 +91,7 @@ func (*SimpleDocker) DownloadImage(opts compiler.CompilerBackendOptions) error {
|
|||||||
func (*SimpleDocker) RemoveImage(opts compiler.CompilerBackendOptions) error {
|
func (*SimpleDocker) RemoveImage(opts compiler.CompilerBackendOptions) error {
|
||||||
name := opts.ImageName
|
name := opts.ImageName
|
||||||
buildarg := []string{"rmi", name}
|
buildarg := []string{"rmi", name}
|
||||||
Spinner(22)
|
Spinner(24)
|
||||||
defer SpinnerStop()
|
defer SpinnerStop()
|
||||||
out, err := exec.Command("docker", buildarg...).CombinedOutput()
|
out, err := exec.Command("docker", buildarg...).CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -119,9 +119,9 @@ func (*SimpleDocker) ExportImage(opts compiler.CompilerBackendOptions) error {
|
|||||||
path := opts.Destination
|
path := opts.Destination
|
||||||
|
|
||||||
buildarg := []string{"save", name, "-o", path}
|
buildarg := []string{"save", name, "-o", path}
|
||||||
Spinner(22)
|
Spinner(24)
|
||||||
defer SpinnerStop()
|
defer SpinnerStop()
|
||||||
Debug("Saving image "+name+" - running docker with: ", buildarg)
|
Debug(" 🐋 Saving image "+name+" - running docker with: ", buildarg)
|
||||||
out, err := exec.Command("docker", buildarg...).CombinedOutput()
|
out, err := exec.Command("docker", buildarg...).CombinedOutput()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Wrap(err, "Failed exporting image: "+string(out))
|
return errors.Wrap(err, "Failed exporting image: "+string(out))
|
||||||
|
@@ -230,7 +230,7 @@ func (cs *LuetCompiler) packageFromImage(p CompilationSpec, tag string, keepPerm
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (cs *LuetCompiler) Compile(concurrency int, keepPermissions bool, p CompilationSpec) (Artifact, error) {
|
func (cs *LuetCompiler) Compile(concurrency int, keepPermissions bool, p CompilationSpec) (Artifact, error) {
|
||||||
Debug("Compiling " + p.GetPackage().GetName())
|
Debug(" 📦 Compiling " + p.GetPackage().GetName())
|
||||||
|
|
||||||
err := cs.Tree().ResolveDeps(concurrency) // FIXME: When done in parallel, this could be done on top before starting
|
err := cs.Tree().ResolveDeps(concurrency) // FIXME: When done in parallel, this could be done on top before starting
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -278,11 +278,11 @@ func (cs *LuetCompiler) Compile(concurrency int, keepPermissions bool, p Compila
|
|||||||
departifacts := []Artifact{} // TODO: Return this somehow
|
departifacts := []Artifact{} // TODO: Return this somehow
|
||||||
deperrs := []error{}
|
deperrs := []error{}
|
||||||
var lastHash string
|
var lastHash string
|
||||||
Info("Build dependencies: ( target "+p.GetPackage().GetName()+")", dependencies.Explain())
|
Info(" 📦 Build dependencies: ( target "+p.GetPackage().GetName()+")", dependencies.Explain())
|
||||||
|
|
||||||
for _, assertion := range dependencies { //highly dependent on the order
|
for _, assertion := range dependencies { //highly dependent on the order
|
||||||
if assertion.Value && assertion.Package.Flagged() {
|
if assertion.Value && assertion.Package.Flagged() {
|
||||||
Info("( target "+p.GetPackage().GetName()+") Building", assertion.Package.GetName())
|
Info("( 📦 target "+p.GetPackage().GetName()+") Building", assertion.Package.GetName())
|
||||||
compileSpec, err := cs.FromPackage(assertion.Package)
|
compileSpec, err := cs.FromPackage(assertion.Package)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New("Error while generating compilespec for " + assertion.Package.GetName())
|
return nil, errors.New("Error while generating compilespec for " + assertion.Package.GetName())
|
||||||
@@ -301,8 +301,8 @@ func (cs *LuetCompiler) Compile(concurrency int, keepPermissions bool, p Compila
|
|||||||
|
|
||||||
buildImageHash := "luet/cache:" + nthsolution.Order(depPack.GetFingerPrint()).Drop(depPack).AssertionHash()
|
buildImageHash := "luet/cache:" + nthsolution.Order(depPack.GetFingerPrint()).Drop(depPack).AssertionHash()
|
||||||
currentPackageImageHash := "luet/cache:" + nthsolution.Order(depPack.GetFingerPrint()).AssertionHash()
|
currentPackageImageHash := "luet/cache:" + nthsolution.Order(depPack.GetFingerPrint()).AssertionHash()
|
||||||
Debug("("+p.GetPackage().GetName()+") Builder image name:", buildImageHash)
|
Debug("( 📦"+p.GetPackage().GetName()+") 🐋 Builder image name:", buildImageHash)
|
||||||
Debug("("+p.GetPackage().GetName()+") Package image name:", currentPackageImageHash)
|
Debug("( 📦 "+p.GetPackage().GetName()+") 🐋 Package image name:", currentPackageImageHash)
|
||||||
|
|
||||||
lastHash = currentPackageImageHash
|
lastHash = currentPackageImageHash
|
||||||
if compileSpec.GetImage() != "" {
|
if compileSpec.GetImage() != "" {
|
||||||
@@ -317,7 +317,7 @@ func (cs *LuetCompiler) Compile(concurrency int, keepPermissions bool, p Compila
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug("(" + p.GetPackage().GetName() + ") Compiling " + compileSpec.GetPackage().GetFingerPrint() + " from image")
|
Debug(" 📦 (" + p.GetPackage().GetName() + ") Compiling " + compileSpec.GetPackage().GetFingerPrint() + " from image")
|
||||||
artifact, err := cs.compileWithImage(compileSpec.GetImage(), buildImageHash, currentPackageImageHash, concurrency, keepPermissions, compileSpec)
|
artifact, err := cs.compileWithImage(compileSpec.GetImage(), buildImageHash, currentPackageImageHash, concurrency, keepPermissions, compileSpec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
deperrs = append(deperrs, err)
|
deperrs = append(deperrs, err)
|
||||||
@@ -336,7 +336,7 @@ func (cs *LuetCompiler) Compile(concurrency int, keepPermissions bool, p Compila
|
|||||||
departifacts = append(departifacts, artifact)
|
departifacts = append(departifacts, artifact)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Debug("("+p.GetPackage().GetName()+") Building target from", lastHash)
|
Debug(" 📦 ("+p.GetPackage().GetName()+") Building target from", lastHash)
|
||||||
|
|
||||||
return cs.compileWithImage(lastHash, "", "", concurrency, keepPermissions, p)
|
return cs.compileWithImage(lastHash, "", "", concurrency, keepPermissions, p)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user