mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
build: display build details link
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@ -33,6 +33,11 @@ type Printer struct {
|
||||
warnings []client.VertexWarning
|
||||
logMu sync.Mutex
|
||||
logSourceMap map[digest.Digest]interface{}
|
||||
|
||||
// TODO: remove once we can use result context to pass build ref
|
||||
// see https://github.com/docker/buildx/pull/1861
|
||||
buildRefsMu sync.Mutex
|
||||
buildRefs map[string]string
|
||||
}
|
||||
|
||||
func (p *Printer) Wait() error {
|
||||
@ -143,6 +148,19 @@ func NewPrinter(ctx context.Context, w io.Writer, out console.File, mode string,
|
||||
return pw, nil
|
||||
}
|
||||
|
||||
func (p *Printer) WriteBuildRef(target string, ref string) {
|
||||
p.buildRefsMu.Lock()
|
||||
defer p.buildRefsMu.Unlock()
|
||||
if p.buildRefs == nil {
|
||||
p.buildRefs = map[string]string{}
|
||||
}
|
||||
p.buildRefs[target] = ref
|
||||
}
|
||||
|
||||
func (p *Printer) BuildRefs() map[string]string {
|
||||
return p.buildRefs
|
||||
}
|
||||
|
||||
type printerOpts struct {
|
||||
displayOpts []progressui.DisplaySolveStatusOpt
|
||||
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
|
||||
type Writer interface {
|
||||
Write(*client.SolveStatus)
|
||||
WriteBuildRef(string, string)
|
||||
ValidateLogSource(digest.Digest, interface{}) bool
|
||||
ClearLogSource(interface{})
|
||||
}
|
||||
@ -41,6 +42,10 @@ func Write(w Writer, name string, f func() error) {
|
||||
})
|
||||
}
|
||||
|
||||
func WriteBuildRef(w Writer, target string, ref string) {
|
||||
w.WriteBuildRef(target, ref)
|
||||
}
|
||||
|
||||
func NewChannel(w Writer) (chan *client.SolveStatus, chan struct{}) {
|
||||
ch := make(chan *client.SolveStatus)
|
||||
done := make(chan struct{})
|
||||
|
Reference in New Issue
Block a user