Merge pull request #370 from TomChv/fix-subdir
This commit is contained in:
commit
a9189392b9
@ -234,7 +234,7 @@ func (p *Pipeline) Subdir(ctx context.Context, op *compiler.Value, st llb.State)
|
||||
if err != nil {
|
||||
return st, err
|
||||
}
|
||||
return st.File(
|
||||
return llb.Scratch().File(
|
||||
llb.Copy(
|
||||
st,
|
||||
dir,
|
||||
|
@ -207,6 +207,9 @@ setup() {
|
||||
run "$DAGGER" compute "$TESTDIR"/ops/subdir/simple
|
||||
assert_success
|
||||
assert_line '{"hello":"world"}'
|
||||
|
||||
run "$DAGGER" compute "$TESTDIR"/ops/subdir/error
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "op.#DockerBuild" {
|
||||
|
31
tests/ops/subdir/error/main.cue
Normal file
31
tests/ops/subdir/error/main.cue
Normal file
@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import "dagger.io/dagger/op"
|
||||
|
||||
hello: {
|
||||
string
|
||||
|
||||
#up: [
|
||||
op.#FetchContainer & {
|
||||
ref: "alpine"
|
||||
},
|
||||
op.#Exec & {
|
||||
args: ["mkdir", "-p", "/tmp/foo"]
|
||||
},
|
||||
op.#Exec & {
|
||||
args: ["sh", "-c", "echo -n world > /tmp/foo/hello"]
|
||||
},
|
||||
op.#Subdir & {
|
||||
dir: "/tmp/foo"
|
||||
},
|
||||
// Should FAIL
|
||||
op.#Exec & {
|
||||
always: true
|
||||
args: ["ls"]
|
||||
},
|
||||
op.#Export & {
|
||||
source: "./hello"
|
||||
format: "string"
|
||||
},
|
||||
]
|
||||
}
|
@ -19,7 +19,7 @@ hello: {
|
||||
dir: "/tmp/foo"
|
||||
},
|
||||
op.#Export & {
|
||||
source: "/hello"
|
||||
source: "./hello"
|
||||
format: "string"
|
||||
},
|
||||
]
|
||||
|
Reference in New Issue
Block a user