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 ( var (
ErrNotTask = errors.New("not a task") ErrNotTask = errors.New("not a task")
tasks sync.Map 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 type NewFunc func() Task

View File

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

View File

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

View File

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

View File

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