docs: deploy using dagger

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-05-28 20:11:17 -07:00
parent 39527b761d
commit c95b5d2bae
7 changed files with 229 additions and 0 deletions

View File

@@ -213,6 +213,8 @@ func (p *Pipeline) doOp(ctx context.Context, op *compiler.Value, st llb.State) (
return p.Local(ctx, op, st)
case "load":
return p.Load(ctx, op, st)
case "workdir":
return p.Workdir(ctx, op, st)
case "subdir":
return p.Subdir(ctx, op, st)
case "docker-build":
@@ -232,6 +234,14 @@ func (p *Pipeline) vertexNamef(format string, a ...interface{}) string {
return prefix + " " + name
}
func (p *Pipeline) Workdir(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) {
path, err := op.Lookup("path").String()
if err != nil {
return st, err
}
return st.Dir(path), nil
}
func (p *Pipeline) Subdir(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) {
// FIXME: this could be more optimized by carrying subdir path as metadata,
// and using it in copy, load or mount.