Fix and improve examples/simple

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2021-01-26 16:37:11 -08:00
parent a26b767780
commit 6f4577d501
3 changed files with 36 additions and 17 deletions

View File

@@ -32,11 +32,15 @@ package dagger
// by scripts defining how to compute it, present it to a user,
// encrypt it, etc.
// FIXME: #Component will not match embedded scalars.
// use Runtime.isComponent() for a reliable check
#Component: {
// Match structs
#dagger: #ComponentConfig
...
} | {
// Match embedded strings
// FIXME: match all embedded scalar types
string
#dagger: #ComponentConfig
}
// The contents of a #dagger annotation
@@ -65,7 +69,7 @@ package dagger
#Local: {
do: "local"
dir: string
include?: [...string] | *[]
include: [...string] | *[]
}
// FIXME: bring back load (more efficient than copy)
@@ -81,17 +85,17 @@ package dagger
env?: [string]: string
always?: true | *false
dir: string | *"/"
mount?: [string]: #MountTmp | #MountCache | #MountComponent | #MountScript
mount: [string]: #MountTmp | #MountCache | #MountComponent | #MountScript
}
#MountTmp: "tmpfs"
#MountCache: "cache"
#MountComponent: {
input: #Component
from: #Component
path: string | *"/"
}
#MountScript: {
input: #Script
from: #Script
path: string | *"/"
}
@@ -107,13 +111,8 @@ package dagger
}
#Copy: {
do: "copy"
from: #Script | #Component
do: "copy"
from: #Script | #Component
src: string | *"/"
dest: string | *"/"
}
#TestScript: #Script & [
{do: "fetch-container", ref: "alpine:latest"},
{do: "exec", args: ["echo", "hello", "world"]},
]