Merge pull request #1521 from talentedmrjones/europa-engine-copy-docker-copy
engine.#Copy matches docker.#Copy
This commit is contained in:
commit
f47d44da79
@ -69,9 +69,15 @@ package engine
|
||||
// Copy files from one FS tree to another
|
||||
#Copy: {
|
||||
$dagger: task: _name: "Copy"
|
||||
|
||||
// Input of the operation
|
||||
input: #FS
|
||||
#CopyInfo
|
||||
// Contents to copy
|
||||
contents: #FS
|
||||
// Source path (optional)
|
||||
source: string | *"/"
|
||||
// Destination path (optional)
|
||||
dest: string | *"/"
|
||||
// Output of the operation
|
||||
output: #FS
|
||||
}
|
||||
|
||||
|
@ -26,10 +26,8 @@ import (
|
||||
// Copy action
|
||||
_copy: engine.#Copy & {
|
||||
"input": engine.#Scratch
|
||||
source: {
|
||||
root: input
|
||||
"path": path
|
||||
}
|
||||
contents: input
|
||||
source: path
|
||||
dest: "/"
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,8 @@ import (
|
||||
// Execute copy operation
|
||||
_copy: engine.#Copy & {
|
||||
"input": input.rootfs
|
||||
"source": {
|
||||
root: contents
|
||||
path: source
|
||||
}
|
||||
"contents": contents
|
||||
"source": source
|
||||
"dest": dest
|
||||
}
|
||||
|
||||
|
@ -99,7 +99,7 @@ engine.#Plan & {
|
||||
|
||||
appImage: engine.#Copy & {
|
||||
input: runtimeImage.output
|
||||
source: root: inputs.directories.app.contents
|
||||
contents: inputs.directories.app.contents
|
||||
dest: "/app"
|
||||
}
|
||||
|
||||
|
@ -29,17 +29,17 @@ func (t *copyTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sourceRoot, err := pctx.FS.FromValue(v.Lookup("source.root"))
|
||||
contents, err := pctx.FS.FromValue(v.Lookup("contents"))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sourceState, err := sourceRoot.State()
|
||||
contentsState, err := contents.State()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
sourcePath, err := v.Lookup("source.path").String()
|
||||
sourcePath, err := v.Lookup("source").String()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -51,7 +51,7 @@ func (t *copyTask) Run(ctx context.Context, pctx *plancontext.Context, s solver.
|
||||
|
||||
outputState := inputState.File(
|
||||
llb.Copy(
|
||||
sourceState,
|
||||
contentsState,
|
||||
sourcePath,
|
||||
destPath,
|
||||
// FIXME: allow more configurable llb options
|
||||
|
@ -30,12 +30,11 @@ engine.#Plan & {
|
||||
|
||||
copy: engine.#Copy & {
|
||||
input: image.output
|
||||
source: {
|
||||
root: exec.output
|
||||
path: "/output.txt"
|
||||
}
|
||||
contents: exec.output
|
||||
source: "/output.txt"
|
||||
dest: "/output.txt"
|
||||
}
|
||||
|
||||
verify_copy: engine.#ReadFile & {
|
||||
input: copy.output
|
||||
path: "/output.txt"
|
||||
|
@ -30,10 +30,8 @@ engine.#Plan & {
|
||||
|
||||
copy: engine.#Copy & {
|
||||
input: image.output
|
||||
source: {
|
||||
root: exec.output
|
||||
path: "/output.txt"
|
||||
}
|
||||
contents: exec.output
|
||||
source: "/output.txt"
|
||||
dest: "/output.txt"
|
||||
}
|
||||
verify_copy: engine.#ReadFile & {
|
||||
|
@ -24,10 +24,8 @@ engine.#Plan & {
|
||||
|
||||
copy: engine.#Copy & {
|
||||
input: busybox1_34_1.output
|
||||
source: {
|
||||
root: alpine3_15_0.output
|
||||
path: "/etc/alpine-release"
|
||||
}
|
||||
contents: alpine3_15_0.output
|
||||
source: "/etc/alpine-release"
|
||||
dest: "/alpine3_15_0_release"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user