Finalize switch to dagger: task: _name

Signed-off-by: Joel Longtine <joel@dagger.io>
This commit is contained in:
Joel Longtine
2021-12-20 10:41:52 -07:00
parent 1ea035ff16
commit 1f28ce518d
2 changed files with 15 additions and 28 deletions

View File

@@ -2,9 +2,7 @@ package task
import (
"context"
"fmt"
"cuelang.org/go/cue"
"github.com/moby/buildkit/client/llb"
"go.dagger.io/dagger/compiler"
"go.dagger.io/dagger/plancontext"
@@ -40,14 +38,11 @@ func (t *copyTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.
}
sourceState, err := sourceRoot.Result().ToState()
if err != nil {
return nil, err
}
sourcePath, err := v.Lookup("source.path").String()
fmt.Println(sourcePath)
if err != nil {
return nil, err
}
@@ -82,11 +77,15 @@ func (t *copyTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.
fs := pctx.FS.New(result)
output := compiler.NewValue()
return compiler.NewValue().FillFields(map[string]interface{}{
"output": fs.MarshalCUE(),
})
if err := output.FillPath(cue.ParsePath("output"), fs.MarshalCUE()); err != nil {
return nil, err
}
// output := compiler.NewValue()
return output, nil
// if err := output.FillPath(cue.ParsePath("output"), fs.MarshalCUE()); err != nil {
// return nil, err
// }
// return output, nil
}