This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/plan/task/pipeline.go
Andrea Luzzardi d82baa4c2d engine: task naming consistency
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2021-12-22 16:19:40 +01:00

28 lines
647 B
Go

package task
import (
"context"
"go.dagger.io/dagger/compiler"
"go.dagger.io/dagger/environment"
"go.dagger.io/dagger/plancontext"
"go.dagger.io/dagger/solver"
)
func init() {
Register("#up", func() Task { return &pipelineTask{} })
}
// pipelineTask is an adapter for legacy pipelines (`#up`).
// FIXME: remove once fully migrated to Europa.
type pipelineTask struct {
}
func (c *pipelineTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.Solver, v *compiler.Value) (*compiler.Value, error) {
p := environment.NewPipeline(v, s, pctx)
if err := p.Run(ctx); err != nil {
return nil, err
}
return p.Computed(), nil
}