Merge pull request #1269 from jlongtine/new-task-structure

Complete move to `$dagger: task: _name`
This commit is contained in:
Joel Longtine 2021-12-20 11:18:45 -07:00 committed by GitHub
commit fb91b27ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 10 deletions

View File

@ -17,7 +17,10 @@ import (
var (
ErrNotTask = errors.New("not a task")
tasks sync.Map
typePath = cue.MakePath(cue.Hid("_type", stdlib.EnginePackage))
typePath = cue.MakePath(
cue.Str("$dagger"),
cue.Str("task"),
cue.Hid("_name", stdlib.EnginePackage))
)
type NewFunc func() Task

View File

@ -2,7 +2,6 @@ package engine
// Execute a command in a container
#Exec: {
_type: "Exec"
$dagger: task: _name: "Exec"
// Container filesystem

View File

@ -2,7 +2,6 @@ package engine
// Read a file from a filesystem tree
#ReadFile: {
_type: "ReadFile"
$dagger: task: _name: "ReadFile"
// Filesystem tree holding the file
@ -18,7 +17,6 @@ package engine
// Write a file to a filesystem tree, creating it if needed
#WriteFile: {
_type: "WriteFile"
$dagger: task: _name: "WriteFile"
// Input filesystem tree

View File

@ -47,7 +47,6 @@ package engine
// Download a container image from a remote repository
#Pull: {
_type: "Pull"
$dagger: task: _name: "Pull"
// Repository source ref

View File

@ -35,7 +35,7 @@ package engine
_#inputDirectory: {
// FIXME: rename to "InputDirectory" for consistency
_type: "LocalDirectory"
$dagger: task: _name: "LocalDirectory"
// Import from this path ON THE CLIENT MACHINE
// Example: "/Users/Alice/dev/todoapp/src"
@ -72,11 +72,11 @@ _#inputSecret: {
interactive: true | *false
} | {
// Read secret from a file ON THE CLIENT MACHINE
_type: "SecretFile"
path: string
$dagger: task: _name: "SecretFile"
path: string
} | {
// Read secret from an environment variable ON THE CLIENT MACHINE
_type: "SecretEnv"
$dagger: task: _name: "SecretEnv"
envvar: string
}
}
@ -96,7 +96,7 @@ _#outputDirectory: {
_#proxyEndpoint: {
// Service endpoint can be proxied to action containers as unix sockets
// FIXME: should #Service be renamed to #ServiceEndpoint or #Endpoint? Naming things is hard...
_type: "Service"
$dagger: task: _name: "Service"
// FIXME: should be endpoint
service: #Service
endpoint: service