|
@@ -58,13 +58,13 @@ func (s *composeService) Build(ctx context.Context, project *types.Project, opti
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
- return progress.RunWithTitle(ctx, func(ctx context.Context) error {
|
|
|
|
|
|
|
+ return progress.Run(ctx, func(ctx context.Context) error {
|
|
|
return tracing.SpanWrapFunc("project/build", tracing.ProjectOptions(ctx, project),
|
|
return tracing.SpanWrapFunc("project/build", tracing.ProjectOptions(ctx, project),
|
|
|
func(ctx context.Context) error {
|
|
func(ctx context.Context) error {
|
|
|
_, err := s.build(ctx, project, options, nil)
|
|
_, err := s.build(ctx, project, options, nil)
|
|
|
return err
|
|
return err
|
|
|
})(ctx)
|
|
})(ctx)
|
|
|
- }, s.stdinfo(), "Building")
|
|
|
|
|
|
|
+ }, s.stdinfo(), "build")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//nolint:gocyclo
|
|
//nolint:gocyclo
|
|
@@ -204,16 +204,12 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
|
|
|
if !ok {
|
|
if !ok {
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
- serviceName := fmt.Sprintf("Service %s", name)
|
|
|
|
|
-
|
|
|
|
|
if !buildkitEnabled {
|
|
if !buildkitEnabled {
|
|
|
trace.SpanFromContext(ctx).SetAttributes(attribute.String("builder", "classic"))
|
|
trace.SpanFromContext(ctx).SetAttributes(attribute.String("builder", "classic"))
|
|
|
- s.events(ctx, progress.BuildingEvent(serviceName))
|
|
|
|
|
id, err := s.doBuildClassic(ctx, project, service, options)
|
|
id, err := s.doBuildClassic(ctx, project, service, options)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
- s.events(ctx, progress.BuiltEvent(serviceName))
|
|
|
|
|
builtDigests[getServiceIndex(name)] = id
|
|
builtDigests[getServiceIndex(name)] = id
|
|
|
|
|
|
|
|
if options.Push {
|
|
if options.Push {
|
|
@@ -230,6 +226,7 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
|
|
+ s.events(ctx, progress.BuildingEvent("Image "+buildOptions.Tags[0]))
|
|
|
|
|
|
|
|
trace.SpanFromContext(ctx).SetAttributes(attribute.String("builder", "buildkit"))
|
|
trace.SpanFromContext(ctx).SetAttributes(attribute.String("builder", "buildkit"))
|
|
|
digest, err := s.doBuildBuildkit(ctx, name, buildOptions, w, nodes)
|
|
digest, err := s.doBuildBuildkit(ctx, name, buildOptions, w, nodes)
|
|
@@ -259,7 +256,7 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
|
|
|
service := project.Services[names[i]]
|
|
service := project.Services[names[i]]
|
|
|
imageRef := api.GetImageNameOrDefault(service, project.Name)
|
|
imageRef := api.GetImageNameOrDefault(service, project.Name)
|
|
|
imageIDs[imageRef] = imageDigest
|
|
imageIDs[imageRef] = imageDigest
|
|
|
- s.events(ctx, progress.BuiltEvent(names[i]))
|
|
|
|
|
|
|
+ s.events(ctx, progress.BuiltEvent("Image "+imageRef))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return imageIDs, err
|
|
return imageIDs, err
|