2021-04-06 02:27:51 +02:00
|
|
|
// op: low-level operations for Dagger processing pipelines
|
|
|
|
package op
|
2021-03-13 09:04:03 +01:00
|
|
|
|
2021-04-02 23:58:12 +02:00
|
|
|
// One operation in a pipeline
|
2021-05-14 01:20:58 +02:00
|
|
|
//
|
|
|
|
// #Op does not enforce the op spec at full resolution, to avoid triggering performance issues.
|
|
|
|
// See https://github.com/dagger/dagger/issues/445
|
|
|
|
#Op: {
|
|
|
|
do: string
|
|
|
|
...
|
|
|
|
}
|
|
|
|
|
|
|
|
// Full resolution schema enforciong the complete op spec
|
|
|
|
#OpFull: #Export |
|
2021-03-16 18:56:35 +01:00
|
|
|
#FetchContainer |
|
|
|
|
#PushContainer |
|
|
|
|
#FetchGit |
|
2021-03-16 20:20:29 +01:00
|
|
|
#Exec |
|
2021-03-16 18:56:35 +01:00
|
|
|
#Local |
|
|
|
|
#Copy |
|
|
|
|
#Load |
|
|
|
|
#Subdir |
|
2021-03-16 20:20:29 +01:00
|
|
|
#WriteFile |
|
2021-03-16 18:56:35 +01:00
|
|
|
#Mkdir |
|
2021-03-16 21:59:32 +01:00
|
|
|
#DockerBuild
|
2021-03-13 09:04:03 +01:00
|
|
|
|
|
|
|
// Export a value from fs state to cue
|
|
|
|
#Export: {
|
|
|
|
do: "export"
|
|
|
|
// Source path in the container
|
|
|
|
source: string
|
|
|
|
format: "json" | "yaml" | *"string"
|
|
|
|
}
|
|
|
|
|
|
|
|
#Local: {
|
|
|
|
do: "local"
|
|
|
|
dir: string
|
|
|
|
include: [...string]
|
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: bring back load (more efficient than copy)
|
|
|
|
|
|
|
|
#Load: {
|
2021-04-24 01:58:29 +02:00
|
|
|
do: "load"
|
2021-03-13 09:04:03 +01:00
|
|
|
from: _
|
|
|
|
}
|
|
|
|
|
|
|
|
#Subdir: {
|
|
|
|
do: "subdir"
|
2021-04-07 18:57:39 +02:00
|
|
|
dir: string
|
2021-03-13 09:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#Exec: {
|
|
|
|
do: "exec"
|
|
|
|
args: [...string]
|
|
|
|
env?: [string]: string
|
2021-04-15 21:34:15 +02:00
|
|
|
// `true` means also ignoring the mount cache volumes
|
2021-03-13 09:04:03 +01:00
|
|
|
always?: true | *false
|
|
|
|
dir: string | *"/"
|
2021-05-14 01:20:58 +02:00
|
|
|
mount: [string]: "tmpfs" | "cache" | {from: _, path: string | *"/"}
|
2021-05-11 23:36:57 +02:00
|
|
|
// Map of hostnames to ip
|
|
|
|
hosts?: [string]: string
|
|
|
|
// User to exec with (if left empty, will default to the set user in the image)
|
|
|
|
user?: string
|
2021-03-13 09:04:03 +01:00
|
|
|
}
|
|
|
|
|
2021-04-27 02:41:04 +02:00
|
|
|
#DockerLogin: {
|
|
|
|
do: "docker-login"
|
|
|
|
target: string | *"https://index.docker.io/v1/"
|
|
|
|
username: string
|
|
|
|
// FIXME: should be a #Secret (circular import)
|
|
|
|
secret: string | bytes
|
|
|
|
}
|
|
|
|
|
2021-03-13 09:04:03 +01:00
|
|
|
#FetchContainer: {
|
2021-04-24 01:58:29 +02:00
|
|
|
do: "fetch-container"
|
|
|
|
ref: string
|
2021-03-13 09:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#PushContainer: {
|
2021-04-24 01:58:29 +02:00
|
|
|
do: "push-container"
|
|
|
|
ref: string
|
2021-03-13 09:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#FetchGit: {
|
2021-05-13 19:02:43 +02:00
|
|
|
do: "fetch-git"
|
|
|
|
remote: string
|
|
|
|
ref: string
|
|
|
|
keepGitDir?: bool
|
|
|
|
// FIXME: the two options are currently ignored until we support buildkit secrets
|
|
|
|
authTokenSecret?: string | bytes
|
|
|
|
authHeaderSecret?: string | bytes
|
2021-03-13 09:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#Copy: {
|
2021-04-24 01:58:29 +02:00
|
|
|
do: "copy"
|
2021-03-13 09:04:03 +01:00
|
|
|
from: _
|
|
|
|
src: string | *"/"
|
|
|
|
dest: string | *"/"
|
|
|
|
}
|
|
|
|
|
|
|
|
#DockerBuild: {
|
|
|
|
do: "docker-build"
|
|
|
|
// We accept either a context, a Dockerfile or both together
|
|
|
|
context?: _
|
|
|
|
dockerfilePath?: string // path to the Dockerfile (defaults to "Dockerfile")
|
|
|
|
dockerfile?: string
|
|
|
|
|
|
|
|
platforms?: [...string]
|
|
|
|
buildArg?: [string]: string
|
|
|
|
label?: [string]: string
|
2021-05-10 06:09:13 +02:00
|
|
|
target?: string
|
2021-05-10 06:09:56 +02:00
|
|
|
hosts?: [string]: string
|
2021-03-13 09:04:03 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#WriteFile: {
|
|
|
|
do: "write-file"
|
2021-04-09 08:52:17 +02:00
|
|
|
content: string | bytes
|
2021-03-13 09:04:03 +01:00
|
|
|
dest: string
|
|
|
|
mode: int | *0o644
|
|
|
|
}
|
|
|
|
|
|
|
|
#Mkdir: {
|
|
|
|
do: "mkdir"
|
|
|
|
dir: *"/" | string
|
|
|
|
path: string
|
|
|
|
mode: int | *0o755
|
|
|
|
}
|