stdlib: dagger.io/dagger/op: stricter typing for load, mount, copy

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes 2021-04-22 00:35:23 +00:00
parent eb61f24cea
commit 3e2b46bf3a

View File

@ -1,6 +1,11 @@
// op: low-level operations for Dagger processing pipelines // op: low-level operations for Dagger processing pipelines
package op package op
// Cue data which can be executed as code
#Runnable: [...#Op] | {#up: [...#Op]
...
}
// One operation in a pipeline // One operation in a pipeline
#Op: #Export | #Op: #Export |
#FetchContainer | #FetchContainer |
@ -33,7 +38,7 @@ package op
#Load: { #Load: {
do: "load" do: "load"
from: _ from: #Runnable
} }
#Subdir: { #Subdir: {
@ -48,7 +53,7 @@ package op
// `true` means also ignoring the mount cache volumes // `true` means also ignoring the mount cache volumes
always?: true | *false always?: true | *false
dir: string | *"/" dir: string | *"/"
mount: [string]: "tmpfs" | "cache" | {from: _, path: string | *"/"} mount: [string]: "tmpfs" | "cache" | {from: #Runnable, path: string | *"/"}
} }
#FetchContainer: { #FetchContainer: {
@ -69,7 +74,7 @@ package op
#Copy: { #Copy: {
do: "copy" do: "copy"
from: _ from: #Runnable
src: string | *"/" src: string | *"/"
dest: string | *"/" dest: string | *"/"
} }
@ -77,7 +82,7 @@ package op
#DockerBuild: { #DockerBuild: {
do: "docker-build" do: "docker-build"
// We accept either a context, a Dockerfile or both together // We accept either a context, a Dockerfile or both together
context?: _ context?: #Runnable
dockerfilePath?: string // path to the Dockerfile (defaults to "Dockerfile") dockerfilePath?: string // path to the Dockerfile (defaults to "Dockerfile")
dockerfile?: string dockerfile?: string