Merge dagger.io/dagger/engine into dagger.io/dagger
Signed-off-by: Solomon Hykes <solomon@dagger.io>
This commit is contained in:
parent
bf6d463833
commit
c2766c265b
52
docs/learn/1213-api.md
Normal file
52
docs/learn/1213-api.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
---
|
||||||
|
slug: /1213/api
|
||||||
|
displayed_sidebar: europaSidebar
|
||||||
|
---
|
||||||
|
|
||||||
|
# Dagger CUE API (0.2+)
|
||||||
|
|
||||||
|
As of Dagger 0.2 (codename Europa), the Dagger CUE API can be imported at `dagger.io/dagger`.
|
||||||
|
|
||||||
|
The Dagger CUE API is the set of CUE packages released alongside the Dagger engine, to allow developers to access its features.
|
||||||
|
|
||||||
|
### Plan definition
|
||||||
|
|
||||||
|
`#Plan` defines the structure of a Dagger plan - a complete configuration executable by `dagger up`.
|
||||||
|
|
||||||
|
### Core types
|
||||||
|
|
||||||
|
Dagger extends the CUE type system with the following core types:
|
||||||
|
|
||||||
|
* `#FS`: a reference to a filesystem tree
|
||||||
|
* `#Secret`: a secure reference to an external secret
|
||||||
|
* `#Service` a reference to a network service endpoints
|
||||||
|
|
||||||
|
### Core actions
|
||||||
|
|
||||||
|
Dagger works by executing actions in a certain order and passing data between actions in a certain layout.
|
||||||
|
|
||||||
|
Developers can combine actions into higher-level actions, which in turn can be combined into even higher-level actions,
|
||||||
|
and so on at arbitrary levels of depth. At the bottom of this abstraction stack are *core actions*: these
|
||||||
|
are implemented by Dagger itself, and are always available.
|
||||||
|
|
||||||
|
The following core actions are available:
|
||||||
|
|
||||||
|
| Core action | File | Description |
|
||||||
|
| -- | -- | -- |
|
||||||
|
| `#Exec` | exec.cue | Execute a command in a docker-compatible container |
|
||||||
|
| `#HTTPFetch` | http.cue | Download an archive from an HTTP server |
|
||||||
|
| `#Push` | image.cue | Upload an image to a docker registry |
|
||||||
|
| `#Pull` | image.cue | Download an image from a docker registry |
|
||||||
|
| `#Dockerfile` | image.cue | Execute a Dockerfile |
|
||||||
|
| `#Set` | image.cue | Modify a docker image |
|
||||||
|
| `#GitPush` | git.cue | Upload a repository to a remote git server |
|
||||||
|
| `#GitPull` | git.cue | Download a repository from a remote git server |
|
||||||
|
| `#DecodeSecret` | secrets.cue | Decode a secret without leaking its contents |
|
||||||
|
| `#NewSecret` | secrets.cue | Dynamically create a new secret |
|
||||||
|
| `#Source` | fs.cue | Access the source for the current CUE package |
|
||||||
|
| `#Mkdir` | fs.cue | Create a directory in a filesystem tree |
|
||||||
|
| `#ReadFile` | fs.cue | Read a file from a tree |
|
||||||
|
| `#WriteFile` | fs.cue | Write a file to a tree |
|
||||||
|
| `#Scratch` | fs.cue | Create an empty tree |
|
||||||
|
| `#Copy` | fs.cue | Copy files between two trees |
|
||||||
|
| `#Subdir` | fs.cue | Read a subdirectory from a filesystem tree |
|
@ -3,7 +3,7 @@ package dagger
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"alpha.dagger.io/dagger/op"
|
"alpha.dagger.io/dagger/op"
|
||||||
"dagger.io/dagger/engine"
|
dagger_0_2 "dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// An artifact such as source code checkout, container image, binary archive...
|
// An artifact such as source code checkout, container image, binary archive...
|
||||||
@ -16,7 +16,7 @@ import (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Dagger stream. Can be mounted as a UNIX socket.
|
// Dagger stream. Can be mounted as a UNIX socket.
|
||||||
#Stream: engine.#Service
|
#Stream: dagger_0_2.#Service
|
||||||
|
|
||||||
// A reference to an external secret, for example:
|
// A reference to an external secret, for example:
|
||||||
// - A password
|
// - A password
|
||||||
@ -24,7 +24,7 @@ import (
|
|||||||
// - An API token
|
// - An API token
|
||||||
// Secrets are never merged in the Cue tree. They can only be used
|
// Secrets are never merged in the Cue tree. They can only be used
|
||||||
// by a special filesystem mount designed to minimize leak risk.
|
// by a special filesystem mount designed to minimize leak risk.
|
||||||
#Secret: engine.#Secret
|
#Secret: dagger_0_2.#Secret
|
||||||
|
|
||||||
#Input: {
|
#Input: {
|
||||||
@dagger(input)
|
@dagger(input)
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
# Europa Core packages
|
|
||||||
|
|
||||||
## About this directory
|
|
||||||
|
|
||||||
`stdlib/europa/` holds the development version of the Core packages for the upcoming [Europa release](https://github.com/dagger/dagger/issues/1088).
|
|
||||||
|
|
||||||
Once Europa is released, `stdlib/europa` will become the new `stdlib/`
|
|
||||||
|
|
||||||
## What are Dagger core packages?
|
|
||||||
|
|
||||||
Dagger core packages are CUE packages released alongside the Dagger engine, to allow developers to access its features.
|
|
||||||
|
|
||||||
### Dagger Core API: `dagger.io/dagger`
|
|
||||||
|
|
||||||
*Development import path: `alpha.dagger.io/europa/dagger`*
|
|
||||||
|
|
||||||
The Dagger Core API defines core types and utilities for programming Dagger:
|
|
||||||
|
|
||||||
* `#Plan`: a complete configuration executable by `dagger up`
|
|
||||||
* `#FS` to reference filesystem state
|
|
||||||
* `#Secret` to (securely) reference external secrets
|
|
||||||
* `#Service` to reference network service endpoints
|
|
||||||
* `#Stream` to reference byte streams
|
|
||||||
|
|
||||||
### Low-level Engine API: `dagger.io/dagger/engine`
|
|
||||||
|
|
||||||
* *Development import path (implemented subset): `alpha.dagger.io/europa/dagger/engine`*
|
|
||||||
* *Development import path (full spec): `alpha.dagger.io/dagger/europa/dagger/engine/spec/engine`*
|
|
||||||
|
|
||||||
`engine` is a low-level API for accessing the raw capabilities of the Dagger Engine. Most developers should use the Dagger Core API instead (`dagger.io/dagger`), but experts and framework developers can target the engine API directly for maximum control.
|
|
||||||
|
|
||||||
This API prioritizes robustness, consistency, and feature completeness. It does NOT prioritize developer convenience or leveraging Cue for composition.
|
|
||||||
|
|
||||||
In Europa, `engine` will deprecate the following implicit API:
|
|
||||||
* Low-level operations defined in `alpha.dagger.io/dagger/op`
|
|
||||||
* Imperative DSL to assemble Dockerfile-like arrays as Cue arrays
|
|
||||||
* Convention to embed pipelines in the Cue lattice with the special nested definition `#up`
|
|
||||||
* Convention to reference filesystem state from the Cue lattice with `@dagger(artifact)`
|
|
||||||
* Convention to reference external secrets from the Cue lattice with `@dagger(secret)`
|
|
||||||
* Convention to reference external network endpoints from the Cue lattice with `@dagger(stream)`
|
|
||||||
* Convention that some operations (specifically `op.#Local`) are meant to be generated at runtime rather than authored manually.
|
|
1
pkg/dagger.io/README.md
Symbolic link
1
pkg/dagger.io/README.md
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../docs/learn/1213-api.md
|
@ -1,156 +0,0 @@
|
|||||||
package engine
|
|
||||||
|
|
||||||
// A special kind of program which `dagger` can execute.
|
|
||||||
#Plan: {
|
|
||||||
// Receive inputs from the client
|
|
||||||
inputs: {
|
|
||||||
// Receive directories
|
|
||||||
directories: [name=string]: _#inputDirectory
|
|
||||||
// Securely receive secrets
|
|
||||||
secrets: [name=string]: _#inputSecret
|
|
||||||
// Receive runtime parameters
|
|
||||||
params: [name=string]: _
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send outputs to the client
|
|
||||||
outputs: {
|
|
||||||
// Export an #FS to the client
|
|
||||||
directories: [name=string]: _#outputDirectory
|
|
||||||
// Export a string to a file
|
|
||||||
files: [name=string]: _#outputFile
|
|
||||||
}
|
|
||||||
|
|
||||||
// Forward network services to and from the client
|
|
||||||
proxy: [endpoint=string]: _#proxyEndpoint
|
|
||||||
|
|
||||||
// Configure platform execution
|
|
||||||
platform?: string
|
|
||||||
|
|
||||||
// Execute actions in containers
|
|
||||||
actions: {
|
|
||||||
...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_#inputDirectory: {
|
|
||||||
// FIXME: rename to "InputDirectory" for consistency
|
|
||||||
$dagger: task: _name: "InputDirectory"
|
|
||||||
|
|
||||||
// Import from this path ON THE CLIENT MACHINE
|
|
||||||
// Example: "/Users/Alice/dev/todoapp/src"
|
|
||||||
path: string
|
|
||||||
|
|
||||||
// Filename patterns to include
|
|
||||||
// Example: ["*.go", "Dockerfile"]
|
|
||||||
include?: [...string]
|
|
||||||
|
|
||||||
// Filename patterns to exclude
|
|
||||||
// Example: ["node_modules"]
|
|
||||||
exclude?: [...string]
|
|
||||||
|
|
||||||
// Imported filesystem contents
|
|
||||||
// Use this as input for actions requiring an #FS field
|
|
||||||
contents: #FS
|
|
||||||
}
|
|
||||||
|
|
||||||
// Securely receive a secret from the client
|
|
||||||
_#inputSecret: {
|
|
||||||
_#inputSecretEnv | _#inputSecretFile | _#inputSecretExec
|
|
||||||
|
|
||||||
// Reference to the secret contents
|
|
||||||
// Use this by securely mounting it into a container.
|
|
||||||
// See universe.dagger.io/docker.#Run.mounts
|
|
||||||
// FIXME: `contents` field name causes confusion (not actually the secret contents..)
|
|
||||||
contents: #Secret
|
|
||||||
|
|
||||||
// Whether to trim leading and trailing space characters from secret value
|
|
||||||
trimSpace: *true | false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read secret from an environment variable ON THE CLIENT MACHINE
|
|
||||||
_#inputSecretEnv: {
|
|
||||||
$dagger: task: _name: "InputSecretEnv"
|
|
||||||
|
|
||||||
envvar: string
|
|
||||||
|
|
||||||
contents: #Secret
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read secret from a file ON THE CLIENT MACHINE
|
|
||||||
_#inputSecretFile: {
|
|
||||||
$dagger: task: _name: "InputSecretFile"
|
|
||||||
|
|
||||||
path: string
|
|
||||||
|
|
||||||
contents: #Secret
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get secret by executing a command ON THE CLIENT MACHINE
|
|
||||||
_#inputSecretExec: {
|
|
||||||
$dagger: task: _name: "InputSecretExec"
|
|
||||||
|
|
||||||
command: {
|
|
||||||
name: string
|
|
||||||
args: [...string]
|
|
||||||
interactive: true | *false @dagger(notimplemented) // FIXME: https://github.com/dagger/dagger/issues/1268
|
|
||||||
}
|
|
||||||
|
|
||||||
contents: #Secret
|
|
||||||
}
|
|
||||||
|
|
||||||
_#outputDirectory: {
|
|
||||||
$dagger: task: _name: "OutputDirectory"
|
|
||||||
|
|
||||||
// Filesystem contents to export
|
|
||||||
// Reference an #FS field produced by an action
|
|
||||||
contents: #FS
|
|
||||||
|
|
||||||
// Export to this path ON THE CLIENT MACHINE
|
|
||||||
dest: string
|
|
||||||
}
|
|
||||||
|
|
||||||
_#outputFile: {
|
|
||||||
$dagger: task: _name: "OutputFile"
|
|
||||||
|
|
||||||
// File contents to export
|
|
||||||
contents: string
|
|
||||||
|
|
||||||
// Export to this path ON THE CLIENT MACHINE
|
|
||||||
dest: string
|
|
||||||
|
|
||||||
// Permissions of the file (defaults to 0o644)
|
|
||||||
permissions?: int
|
|
||||||
}
|
|
||||||
|
|
||||||
// Forward a network endpoint to and from the client
|
|
||||||
_#proxyEndpoint: {
|
|
||||||
$dagger: task: _name: "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...
|
|
||||||
// FIXME: should be endpoint
|
|
||||||
service: #Service
|
|
||||||
endpoint: service
|
|
||||||
{
|
|
||||||
// FIXME: reconcile with spec
|
|
||||||
unix: string
|
|
||||||
} | {
|
|
||||||
// FIXME: reconcile with spec
|
|
||||||
npipe: string
|
|
||||||
} | {
|
|
||||||
// Listen for connections ON THE CLIENT MACHINE, proxy to actions
|
|
||||||
listen: #Address @dagger(notimplemented)
|
|
||||||
} | {
|
|
||||||
// Connect to a remote endpoint FROM THE CLIENT MACHINE, proxy to actions
|
|
||||||
connect: #Address @dagger(notimplemented)
|
|
||||||
} | {
|
|
||||||
// Proxy to/from the contents of a file ON THE CLIENT MACHINE
|
|
||||||
filepath: string @dagger(notimplemented)
|
|
||||||
} | {
|
|
||||||
// Proxy to/from standard input and output of a command ON THE CLIENT MACHINE
|
|
||||||
command: [string, ...string] | string @dagger(notimplemented)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// A network service address
|
|
||||||
#Address: string & =~"^(tcp://|unix://|udp://).*"
|
|
@ -1,45 +0,0 @@
|
|||||||
package engine
|
|
||||||
|
|
||||||
// Create a new a secret from a filesystem tree
|
|
||||||
#NewSecret: {
|
|
||||||
$dagger: task: _name: "NewSecret"
|
|
||||||
|
|
||||||
// Filesystem tree holding the secret
|
|
||||||
input: #FS
|
|
||||||
// Path of the secret to read
|
|
||||||
path: string
|
|
||||||
// Whether to trim leading and trailing space characters from secret value
|
|
||||||
trimSpace: *true | false
|
|
||||||
// Contents of the secret
|
|
||||||
output: #Secret
|
|
||||||
}
|
|
||||||
|
|
||||||
// Securely apply a CUE transformation on the contents of a secret
|
|
||||||
// FIXME: disabled due to data race associated with filling #function.input
|
|
||||||
// #TransformSecret: {
|
|
||||||
// $dagger: task: _name: "TransformSecret"
|
|
||||||
// // The original secret
|
|
||||||
// input: #Secret
|
|
||||||
// // A new secret or (map of secrets) with the transformation applied
|
|
||||||
// output: #Secret | {[string]: output}
|
|
||||||
// // Transformation function
|
|
||||||
// #function: {
|
|
||||||
// // Full contents of the input secret (only available to the function)
|
|
||||||
// input: string
|
|
||||||
// _functionOutput: string | {[string]: _functionOutput}
|
|
||||||
// // New contents of the output secret (must provided by the caller)
|
|
||||||
// output: _functionOutput
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
#DecodeSecret: {
|
|
||||||
$dagger: task: _name: "DecodeSecret"
|
|
||||||
|
|
||||||
// A #Secret whose plain text is a JSON or YAML string
|
|
||||||
input: #Secret
|
|
||||||
|
|
||||||
format: "json" | "yaml"
|
|
||||||
|
|
||||||
// A new secret or (map of secrets) derived from unmarshaling the input secret's plain text
|
|
||||||
output: #Secret | {[string]: output}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
package engine
|
|
||||||
|
|
||||||
// A reference to a filesystem tree.
|
|
||||||
// For example:
|
|
||||||
// - The root filesystem of a container
|
|
||||||
// - A source code repository
|
|
||||||
// - A directory containing binary artifacts
|
|
||||||
// Rule of thumb: if it fits in a tar archive, it fits in a #FS.
|
|
||||||
#FS: {
|
|
||||||
$dagger: fs: _id: string | null
|
|
||||||
}
|
|
||||||
|
|
||||||
// A reference to an external secret, for example:
|
|
||||||
// - A password
|
|
||||||
// - A SSH private key
|
|
||||||
// - An API token
|
|
||||||
// Secrets are never merged in the Cue tree. They can only be used
|
|
||||||
// by a special filesystem mount designed to minimize leak risk.
|
|
||||||
#Secret: {
|
|
||||||
$dagger: secret: _id: string
|
|
||||||
}
|
|
||||||
|
|
||||||
// A reference to a network service endpoint, for example:
|
|
||||||
// - A TCP or UDP port
|
|
||||||
// - A unix or npipe socket
|
|
||||||
// - An HTTPS endpoint
|
|
||||||
#Service: {
|
|
||||||
$dagger: service: _id: string
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
package engine
|
package dagger
|
||||||
|
|
||||||
// Execute a command in a container
|
// Execute a command in a container
|
||||||
#Exec: {
|
#Exec: {
|
@ -1,4 +1,4 @@
|
|||||||
package engine
|
package dagger
|
||||||
|
|
||||||
// Access the source directory for the current CUE package
|
// Access the source directory for the current CUE package
|
||||||
// This may safely be called from any package
|
// This may safely be called from any package
|
||||||
@ -63,9 +63,6 @@ package engine
|
|||||||
output: #FS
|
output: #FS
|
||||||
}
|
}
|
||||||
|
|
||||||
// Produce an empty directory
|
|
||||||
#Scratch: #FS & {$dagger: fs: _id: null}
|
|
||||||
|
|
||||||
// Copy files from one FS tree to another
|
// Copy files from one FS tree to another
|
||||||
#Copy: {
|
#Copy: {
|
||||||
$dagger: task: _name: "Copy"
|
$dagger: task: _name: "Copy"
|
||||||
@ -98,3 +95,24 @@ package engine
|
|||||||
layers: [...#CopyInfo]
|
layers: [...#CopyInfo]
|
||||||
output: #FS
|
output: #FS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Select a subdirectory from a filesystem tree
|
||||||
|
#Subdir: {
|
||||||
|
// Input tree
|
||||||
|
input: #FS
|
||||||
|
|
||||||
|
// Path of the subdirectory
|
||||||
|
// Example: "/build"
|
||||||
|
path: string
|
||||||
|
|
||||||
|
// Copy action
|
||||||
|
_copy: #Copy & {
|
||||||
|
"input": #Scratch
|
||||||
|
contents: input
|
||||||
|
source: path
|
||||||
|
dest: "/"
|
||||||
|
}
|
||||||
|
|
||||||
|
// Subdirectory tree
|
||||||
|
output: #FS & _copy.output
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package engine
|
package dagger
|
||||||
|
|
||||||
// Push a directory to a git remote
|
// Push a directory to a git remote
|
||||||
#GitPush: {
|
#GitPush: {
|
@ -1,4 +1,4 @@
|
|||||||
package engine
|
package dagger
|
||||||
|
|
||||||
// HTTP operations
|
// HTTP operations
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package engine
|
package dagger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"list"
|
"list"
|
@ -1,8 +1,153 @@
|
|||||||
package dagger
|
package dagger
|
||||||
|
|
||||||
import (
|
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
|
||||||
|
|
||||||
// A special kind of program which `dagger` can execute.
|
// A special kind of program which `dagger` can execute.
|
||||||
#Plan: engine.#Plan
|
#Plan: {
|
||||||
|
// Receive inputs from the client
|
||||||
|
inputs: {
|
||||||
|
// Receive directories
|
||||||
|
directories: [name=string]: _#inputDirectory
|
||||||
|
// Securely receive secrets
|
||||||
|
secrets: [name=string]: _#inputSecret
|
||||||
|
// Receive runtime parameters
|
||||||
|
params: [name=string]: _
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send outputs to the client
|
||||||
|
outputs: {
|
||||||
|
// Export an #FS to the client
|
||||||
|
directories: [name=string]: _#outputDirectory
|
||||||
|
// Export a string to a file
|
||||||
|
files: [name=string]: _#outputFile
|
||||||
|
}
|
||||||
|
|
||||||
|
// Forward network services to and from the client
|
||||||
|
proxy: [endpoint=string]: _#proxyEndpoint
|
||||||
|
|
||||||
|
// Configure platform execution
|
||||||
|
platform?: string
|
||||||
|
|
||||||
|
// Execute actions in containers
|
||||||
|
actions: {
|
||||||
|
...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_#inputDirectory: {
|
||||||
|
// FIXME: rename to "InputDirectory" for consistency
|
||||||
|
$dagger: task: _name: "InputDirectory"
|
||||||
|
|
||||||
|
// Import from this path ON THE CLIENT MACHINE
|
||||||
|
// Example: "/Users/Alice/dev/todoapp/src"
|
||||||
|
path: string
|
||||||
|
|
||||||
|
// Filename patterns to include
|
||||||
|
// Example: ["*.go", "Dockerfile"]
|
||||||
|
include?: [...string]
|
||||||
|
|
||||||
|
// Filename patterns to exclude
|
||||||
|
// Example: ["node_modules"]
|
||||||
|
exclude?: [...string]
|
||||||
|
|
||||||
|
// Imported filesystem contents
|
||||||
|
// Use this as input for actions requiring an #FS field
|
||||||
|
contents: #FS
|
||||||
|
}
|
||||||
|
|
||||||
|
// Securely receive a secret from the client
|
||||||
|
_#inputSecret: {
|
||||||
|
_#inputSecretEnv | _#inputSecretFile | _#inputSecretExec
|
||||||
|
|
||||||
|
// Reference to the secret contents
|
||||||
|
// Use this by securely mounting it into a container.
|
||||||
|
// See universe.io/docker.#Run.mounts
|
||||||
|
// FIXME: `contents` field name causes confusion (not actually the secret contents..)
|
||||||
|
contents: #Secret
|
||||||
|
|
||||||
|
// Whether to trim leading and trailing space characters from secret value
|
||||||
|
trimSpace: *true | false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read secret from an environment variable ON THE CLIENT MACHINE
|
||||||
|
_#inputSecretEnv: {
|
||||||
|
$dagger: task: _name: "InputSecretEnv"
|
||||||
|
|
||||||
|
envvar: string
|
||||||
|
|
||||||
|
contents: #Secret
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read secret from a file ON THE CLIENT MACHINE
|
||||||
|
_#inputSecretFile: {
|
||||||
|
$dagger: task: _name: "InputSecretFile"
|
||||||
|
|
||||||
|
path: string
|
||||||
|
|
||||||
|
contents: #Secret
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get secret by executing a command ON THE CLIENT MACHINE
|
||||||
|
_#inputSecretExec: {
|
||||||
|
$dagger: task: _name: "InputSecretExec"
|
||||||
|
|
||||||
|
command: {
|
||||||
|
name: string
|
||||||
|
args: [...string]
|
||||||
|
interactive: true | *false @dagger(notimplemented) // FIXME: https://github.com/dagger/dagger/issues/1268
|
||||||
|
}
|
||||||
|
|
||||||
|
contents: #Secret
|
||||||
|
}
|
||||||
|
|
||||||
|
_#outputDirectory: {
|
||||||
|
$dagger: task: _name: "OutputDirectory"
|
||||||
|
|
||||||
|
// Filesystem contents to export
|
||||||
|
// Reference an #FS field produced by an action
|
||||||
|
contents: #FS
|
||||||
|
|
||||||
|
// Export to this path ON THE CLIENT MACHINE
|
||||||
|
dest: string
|
||||||
|
}
|
||||||
|
|
||||||
|
_#outputFile: {
|
||||||
|
$dagger: task: _name: "OutputFile"
|
||||||
|
|
||||||
|
// File contents to export
|
||||||
|
contents: string
|
||||||
|
|
||||||
|
// Export to this path ON THE CLIENT MACHINE
|
||||||
|
dest: string
|
||||||
|
|
||||||
|
// Permissions of the file (defaults to 0o644)
|
||||||
|
permissions?: int
|
||||||
|
}
|
||||||
|
|
||||||
|
// Forward a network endpoint to and from the client
|
||||||
|
_#proxyEndpoint: {
|
||||||
|
$dagger: task: _name: "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...
|
||||||
|
// FIXME: should be endpoint
|
||||||
|
service: #Service
|
||||||
|
endpoint: service
|
||||||
|
{
|
||||||
|
// FIXME: reconcile with spec
|
||||||
|
unix: string
|
||||||
|
} | {
|
||||||
|
// FIXME: reconcile with spec
|
||||||
|
npipe: string
|
||||||
|
} | {
|
||||||
|
// Listen for connections ON THE CLIENT MACHINE, proxy to actions
|
||||||
|
listen: #Address @dagger(notimplemented)
|
||||||
|
} | {
|
||||||
|
// Connect to a remote endpoint FROM THE CLIENT MACHINE, proxy to actions
|
||||||
|
connect: #Address @dagger(notimplemented)
|
||||||
|
} | {
|
||||||
|
// Proxy to/from the contents of a file ON THE CLIENT MACHINE
|
||||||
|
filepath: string @dagger(notimplemented)
|
||||||
|
} | {
|
||||||
|
// Proxy to/from standard input and output of a command ON THE CLIENT MACHINE
|
||||||
|
command: [string, ...string] | string @dagger(notimplemented)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
29
pkg/dagger.io/dagger/secrets.cue
Normal file
29
pkg/dagger.io/dagger/secrets.cue
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package dagger
|
||||||
|
|
||||||
|
// Decode the contents of a secrets without leaking it.
|
||||||
|
// Supported formats: json, yaml
|
||||||
|
#DecodeSecret: {
|
||||||
|
$dagger: task: _name: "DecodeSecret"
|
||||||
|
|
||||||
|
// A #Secret whose plain text is a JSON or YAML string
|
||||||
|
input: #Secret
|
||||||
|
|
||||||
|
format: "json" | "yaml"
|
||||||
|
|
||||||
|
// A new secret or (map of secrets) derived from unmarshaling the input secret's plain text
|
||||||
|
output: #Secret | {[string]: output}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create a new a secret from a filesystem tree
|
||||||
|
#NewSecret: {
|
||||||
|
$dagger: task: _name: "NewSecret"
|
||||||
|
|
||||||
|
// Filesystem tree holding the secret
|
||||||
|
input: #FS
|
||||||
|
// Path of the secret to read
|
||||||
|
path: string
|
||||||
|
// Whether to trim leading and trailing space characters from secret value
|
||||||
|
trimSpace: *true | false
|
||||||
|
// Contents of the secret
|
||||||
|
output: #Secret
|
||||||
|
}
|
@ -1,16 +1,19 @@
|
|||||||
package dagger
|
package dagger
|
||||||
|
|
||||||
import (
|
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
|
||||||
|
|
||||||
// A reference to a filesystem tree.
|
// A reference to a filesystem tree.
|
||||||
// For example:
|
// For example:
|
||||||
// - The root filesystem of a container
|
// - The root filesystem of a container
|
||||||
// - A source code repository
|
// - A source code repository
|
||||||
// - A directory containing binary artifacts
|
// - A directory containing binary artifacts
|
||||||
// Rule of thumb: if it fits in a tar archive, it fits in a #FS.
|
// Rule of thumb: if it fits in a tar archive, it fits in a #FS.
|
||||||
#FS: engine.#FS
|
#FS: {
|
||||||
|
$dagger: fs: _id: string | null
|
||||||
|
}
|
||||||
|
|
||||||
|
// An empty directory
|
||||||
|
#Scratch: #FS & {
|
||||||
|
$dagger: fs: _id: null
|
||||||
|
}
|
||||||
|
|
||||||
// A reference to an external secret, for example:
|
// A reference to an external secret, for example:
|
||||||
// - A password
|
// - A password
|
||||||
@ -18,13 +21,17 @@ import (
|
|||||||
// - An API token
|
// - An API token
|
||||||
// Secrets are never merged in the Cue tree. They can only be used
|
// Secrets are never merged in the Cue tree. They can only be used
|
||||||
// by a special filesystem mount designed to minimize leak risk.
|
// by a special filesystem mount designed to minimize leak risk.
|
||||||
#Secret: engine.#Secret
|
#Secret: {
|
||||||
|
$dagger: secret: _id: string
|
||||||
|
}
|
||||||
|
|
||||||
// A reference to a network service endpoint, for example:
|
// A reference to a network service endpoint, for example:
|
||||||
// - A TCP or UDP port
|
// - A TCP or UDP port
|
||||||
// - A unix socket
|
// - A unix socket
|
||||||
// - An HTTPS endpoint
|
// - An HTTPS endpoint
|
||||||
#Service: engine.#Service
|
#Service: {
|
||||||
|
$dagger: service: _id: string
|
||||||
|
}
|
||||||
|
|
||||||
// A network service address
|
// A network service address
|
||||||
#Address: engine.#Address
|
#Address: string & =~"^(tcp://|unix://|udp://).*"
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
package dagger
|
|
||||||
|
|
||||||
import (
|
|
||||||
// "encoding/json"
|
|
||||||
// "encoding/yaml"
|
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Access the source directory for the current CUE package
|
|
||||||
// This may safely be called from any package
|
|
||||||
#Source: engine.#Source
|
|
||||||
|
|
||||||
// A (best effort) persistent cache dir
|
|
||||||
#CacheDir: engine.#CacheDir
|
|
||||||
|
|
||||||
// A temporary directory for command execution
|
|
||||||
#TempDir: engine.#TempDir
|
|
||||||
|
|
||||||
// Select a subdirectory from a filesystem tree
|
|
||||||
#Subdir: {
|
|
||||||
// Input tree
|
|
||||||
input: engine.#FS
|
|
||||||
|
|
||||||
// Path of the subdirectory
|
|
||||||
// Example: "/build"
|
|
||||||
path: string
|
|
||||||
|
|
||||||
// Copy action
|
|
||||||
_copy: engine.#Copy & {
|
|
||||||
"input": engine.#Scratch
|
|
||||||
contents: input
|
|
||||||
source: path
|
|
||||||
dest: "/"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Subdirectory tree
|
|
||||||
output: engine.#FS & _copy.output
|
|
||||||
}
|
|
||||||
|
|
||||||
// DecodeSecret is a convenience wrapper around #TransformSecret. The plain text contents of input is expected to match the format
|
|
||||||
// #DecodeSecret: {
|
|
||||||
// {
|
|
||||||
// format: "json"
|
|
||||||
// engine.#TransformSecret & {
|
|
||||||
// #function: {
|
|
||||||
// input: _
|
|
||||||
// output: json.Unmarshal(input)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// } | {
|
|
||||||
// format: "yaml"
|
|
||||||
// engine.#TransformSecret & {
|
|
||||||
// #function: {
|
|
||||||
// input: _
|
|
||||||
// output: yaml.Unmarshal(input)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
#DecodeSecret: engine.#DecodeSecret
|
|
@ -32,7 +32,7 @@ var (
|
|||||||
UniverseModule,
|
UniverseModule,
|
||||||
}
|
}
|
||||||
|
|
||||||
EnginePackage = fmt.Sprintf("%s/dagger/engine", DaggerModule)
|
DaggerPackage = fmt.Sprintf("%s/dagger", DaggerModule)
|
||||||
|
|
||||||
lockFilePath = "dagger.lock"
|
lockFilePath = "dagger.lock"
|
||||||
)
|
)
|
||||||
|
@ -2,7 +2,6 @@ package alpine
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/alpine"
|
"universe.dagger.io/alpine"
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
@ -17,7 +16,7 @@ dagger.#Plan & {
|
|||||||
version: "3.10.9"
|
version: "3.10.9"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Readfile & {
|
verify: dagger.#Readfile & {
|
||||||
input: build.output.rootfs
|
input: build.output.rootfs
|
||||||
path: "/etc/alpine-release"
|
path: "/etc/alpine-release"
|
||||||
contents: "3.10.9\n"
|
contents: "3.10.9\n"
|
||||||
|
@ -3,7 +3,6 @@ package bash
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
)
|
)
|
||||||
@ -27,8 +26,8 @@ import (
|
|||||||
contents: string
|
contents: string
|
||||||
|
|
||||||
_filename: "run.sh"
|
_filename: "run.sh"
|
||||||
_write: engine.#WriteFile & {
|
_write: dagger.#WriteFile & {
|
||||||
input: engine.#Scratch
|
input: dagger.#Scratch
|
||||||
path: _filename
|
path: _filename
|
||||||
"contents": contents
|
"contents": contents
|
||||||
}
|
}
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../../../dagger.io
|
|
@ -2,7 +2,6 @@ package docker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Modular build API for Docker containers
|
// Modular build API for Docker containers
|
||||||
@ -47,7 +46,7 @@ import (
|
|||||||
dest: string | *"/"
|
dest: string | *"/"
|
||||||
|
|
||||||
// Execute copy operation
|
// Execute copy operation
|
||||||
_copy: engine.#Copy & {
|
_copy: dagger.#Copy & {
|
||||||
"input": input.rootfs
|
"input": input.rootfs
|
||||||
"contents": contents
|
"contents": contents
|
||||||
"source": source
|
"source": source
|
||||||
|
@ -2,7 +2,6 @@ package docker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// A container image
|
// A container image
|
||||||
@ -11,7 +10,7 @@ import (
|
|||||||
rootfs: dagger.#FS
|
rootfs: dagger.#FS
|
||||||
|
|
||||||
// Image config
|
// Image config
|
||||||
config: engine.#ImageConfig
|
config: dagger.#ImageConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
// A ref is an address for a remote container image
|
// A ref is an address for a remote container image
|
||||||
@ -21,4 +20,4 @@ import (
|
|||||||
// - "index.docker.io/dagger:latest"
|
// - "index.docker.io/dagger:latest"
|
||||||
// - "index.docker.io/dagger:latest@sha256:a89cb097693dd354de598d279c304a1c73ee550fbfff6d9ee515568e0c749cfe"
|
// - "index.docker.io/dagger:latest@sha256:a89cb097693dd354de598d279c304a1c73ee550fbfff6d9ee515568e0c749cfe"
|
||||||
// FIXME: add formatting constraints
|
// FIXME: add formatting constraints
|
||||||
#Ref: engine.#Ref
|
#Ref: dagger.#Ref
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
package docker
|
package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -17,7 +16,7 @@ import (
|
|||||||
secret: dagger.#Secret
|
secret: dagger.#Secret
|
||||||
}
|
}
|
||||||
|
|
||||||
_op: engine.#Pull & {
|
_op: dagger.#Pull & {
|
||||||
"source": source
|
"source": source
|
||||||
if auth != _|_ {
|
if auth != _|_ {
|
||||||
"auth": auth
|
"auth": auth
|
||||||
|
@ -2,7 +2,6 @@ package docker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Upload an image to a remote repository
|
// Upload an image to a remote repository
|
||||||
@ -22,7 +21,7 @@ import (
|
|||||||
// Image to push
|
// Image to push
|
||||||
image: #Image
|
image: #Image
|
||||||
|
|
||||||
_push: engine.#Push & {
|
_push: dagger.#Push & {
|
||||||
"dest": dest
|
"dest": dest
|
||||||
if auth != _|_ {
|
if auth != _|_ {
|
||||||
"auth": auth
|
"auth": auth
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"list"
|
"list"
|
||||||
|
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Run a command in a container
|
// Run a command in a container
|
||||||
@ -15,7 +14,7 @@ import (
|
|||||||
always: bool | *false
|
always: bool | *false
|
||||||
|
|
||||||
// Filesystem mounts
|
// Filesystem mounts
|
||||||
mounts: [name=string]: engine.#Mount
|
mounts: [name=string]: dagger.#Mount
|
||||||
|
|
||||||
// Expose network ports
|
// Expose network ports
|
||||||
// FIXME: investigate feasibility
|
// FIXME: investigate feasibility
|
||||||
@ -55,7 +54,7 @@ import (
|
|||||||
|
|
||||||
// Environment variables
|
// Environment variables
|
||||||
// Example: {"DEBUG": "1"}
|
// Example: {"DEBUG": "1"}
|
||||||
env: [string]: string | engine.#Secret
|
env: [string]: string | dagger.#Secret
|
||||||
|
|
||||||
// Working directory for the command
|
// Working directory for the command
|
||||||
// Example: "/src"
|
// Example: "/src"
|
||||||
@ -87,7 +86,7 @@ import (
|
|||||||
rootfs: dagger.#FS & _exec.output
|
rootfs: dagger.#FS & _exec.output
|
||||||
files: [path=string]: {
|
files: [path=string]: {
|
||||||
contents: string & _read.contents
|
contents: string & _read.contents
|
||||||
_read: engine.#ReadFile & {
|
_read: dagger.#ReadFile & {
|
||||||
input: _exec.output
|
input: _exec.output
|
||||||
"path": path
|
"path": path
|
||||||
}
|
}
|
||||||
@ -109,7 +108,7 @@ import (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Actually execute the command
|
// Actually execute the command
|
||||||
_exec: engine.#Exec & {
|
_exec: dagger.#Exec & {
|
||||||
"input": input.rootfs
|
"input": input.rootfs
|
||||||
"always": always
|
"always": always
|
||||||
"mounts": mounts
|
"mounts": mounts
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package docker
|
package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Change image config
|
// Change image config
|
||||||
@ -10,9 +10,9 @@ import (
|
|||||||
input: #Image
|
input: #Image
|
||||||
|
|
||||||
// The image config to change
|
// The image config to change
|
||||||
config: engine.#ImageConfig
|
config: dagger.#ImageConfig
|
||||||
|
|
||||||
_set: engine.#Set & {
|
_set: dagger.#Set & {
|
||||||
"input": input.config
|
"input": input.config
|
||||||
"config": config
|
"config": config
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package docker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/alpine"
|
"universe.dagger.io/alpine"
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
@ -27,7 +26,7 @@ dagger.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#ReadFile & {
|
verify: dagger.#ReadFile & {
|
||||||
input: image.output.rootfs
|
input: image.output.rootfs
|
||||||
path: "/test.txt"
|
path: "/test.txt"
|
||||||
}
|
}
|
||||||
@ -60,7 +59,7 @@ dagger.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#ReadFile & {
|
verify: dagger.#ReadFile & {
|
||||||
input: image.output.rootfs
|
input: image.output.rootfs
|
||||||
path: "/test.txt"
|
path: "/test.txt"
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package docker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -13,7 +12,7 @@ dagger.#Plan & {
|
|||||||
// Test: change image config with docker.#Set
|
// Test: change image config with docker.#Set
|
||||||
set: {
|
set: {
|
||||||
image: output: docker.#Image & {
|
image: output: docker.#Image & {
|
||||||
rootfs: engine.#Scratch
|
rootfs: dagger.#Scratch
|
||||||
config: {
|
config: {
|
||||||
cmd: ["/bin/sh"]
|
cmd: ["/bin/sh"]
|
||||||
env: PATH: "/sbin:/bin"
|
env: PATH: "/sbin:/bin"
|
||||||
@ -44,8 +43,8 @@ dagger.#Plan & {
|
|||||||
|
|
||||||
// Test: image config behavior is correct
|
// Test: image config behavior is correct
|
||||||
config: {
|
config: {
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: engine.#Scratch
|
source: dagger.#Scratch
|
||||||
dockerfile: contents: """
|
dockerfile: contents: """
|
||||||
FROM alpine:3.15.0
|
FROM alpine:3.15.0
|
||||||
RUN echo -n 'not hello from dagger' > /dagger.txt
|
RUN echo -n 'not hello from dagger' > /dagger.txt
|
||||||
|
@ -2,7 +2,6 @@ package docker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
"universe.dagger.io/alpine"
|
"universe.dagger.io/alpine"
|
||||||
@ -25,7 +24,7 @@ dagger.#Plan & {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#ReadFile & {
|
verify: dagger.#ReadFile & {
|
||||||
input: run.output.rootfs
|
input: run.output.rootfs
|
||||||
path: "/output.txt"
|
path: "/output.txt"
|
||||||
}
|
}
|
||||||
@ -61,7 +60,7 @@ dagger.#Plan & {
|
|||||||
export: directories: "/test": _
|
export: directories: "/test": _
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#ReadFile & {
|
verify: dagger.#ReadFile & {
|
||||||
input: run.export.directories."/test".contents
|
input: run.export.directories."/test".contents
|
||||||
path: "/output.txt"
|
path: "/output.txt"
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
runtime_image_ref: string | *"thechangelog/runtime:2021-05-29T10.17.12Z"
|
runtime_image_ref: string | *"thechangelog/runtime:2021-05-29T10.17.12Z"
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: app: {
|
inputs: directories: app: {
|
||||||
path: "."
|
path: "."
|
||||||
exclude: [
|
exclude: [
|
||||||
@ -57,11 +56,11 @@ engine.#Plan & {
|
|||||||
}
|
}
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
runtimeImage: engine.#Pull & {
|
runtimeImage: dagger.#Pull & {
|
||||||
source: runtime_image_ref
|
source: runtime_image_ref
|
||||||
}
|
}
|
||||||
|
|
||||||
depsCache: engine.#CacheDir & {
|
depsCache: dagger.#CacheDir & {
|
||||||
id: "depsCache"
|
id: "depsCache"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +69,7 @@ engine.#Plan & {
|
|||||||
contents: depsCache
|
contents: depsCache
|
||||||
}
|
}
|
||||||
|
|
||||||
buildCacheTest: engine.#CacheDir & {
|
buildCacheTest: dagger.#CacheDir & {
|
||||||
id: "buildCacheTest"
|
id: "buildCacheTest"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +78,7 @@ engine.#Plan & {
|
|||||||
contents: buildCacheTest
|
contents: buildCacheTest
|
||||||
}
|
}
|
||||||
|
|
||||||
buildCacheProd: engine.#CacheDir & {
|
buildCacheProd: dagger.#CacheDir & {
|
||||||
id: "buildCacheProd"
|
id: "buildCacheProd"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +87,7 @@ engine.#Plan & {
|
|||||||
contents: buildCacheProd
|
contents: buildCacheProd
|
||||||
}
|
}
|
||||||
|
|
||||||
nodeModulesCache: engine.#CacheDir & {
|
nodeModulesCache: dagger.#CacheDir & {
|
||||||
id: "nodeModulesCache"
|
id: "nodeModulesCache"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,20 +96,20 @@ engine.#Plan & {
|
|||||||
contents: nodeModulesCache
|
contents: nodeModulesCache
|
||||||
}
|
}
|
||||||
|
|
||||||
appImage: engine.#Copy & {
|
appImage: dagger.#Copy & {
|
||||||
input: runtimeImage.output
|
input: runtimeImage.output
|
||||||
contents: inputs.directories.app.contents
|
contents: inputs.directories.app.contents
|
||||||
dest: "/app"
|
dest: "/app"
|
||||||
}
|
}
|
||||||
|
|
||||||
deps: engine.#Exec & {
|
deps: dagger.#Exec & {
|
||||||
input: appImage.output
|
input: appImage.output
|
||||||
mounts: depsCacheMount
|
mounts: depsCacheMount
|
||||||
workdir: "/app"
|
workdir: "/app"
|
||||||
args: ["bash", "-c", " mix deps.get"]
|
args: ["bash", "-c", " mix deps.get"]
|
||||||
}
|
}
|
||||||
|
|
||||||
assetsCompile: engine.#Exec & {
|
assetsCompile: dagger.#Exec & {
|
||||||
input: depsCompileProd.output
|
input: depsCompileProd.output
|
||||||
mounts: depsCacheMount & nodeModulesCacheMount
|
mounts: depsCacheMount & nodeModulesCacheMount
|
||||||
workdir: "/app/assets"
|
workdir: "/app/assets"
|
||||||
@ -118,7 +117,7 @@ engine.#Plan & {
|
|||||||
args: ["bash", "-c", "yarn install --frozen-lockfile && yarn run compile"]
|
args: ["bash", "-c", "yarn install --frozen-lockfile && yarn run compile"]
|
||||||
}
|
}
|
||||||
|
|
||||||
#depsCompile: engine.#Exec & {
|
#depsCompile: dagger.#Exec & {
|
||||||
input: deps.output
|
input: deps.output
|
||||||
mounts: depsCacheMount
|
mounts: depsCacheMount
|
||||||
workdir: "/app"
|
workdir: "/app"
|
||||||
@ -135,7 +134,7 @@ engine.#Plan & {
|
|||||||
mounts: buildCacheProdMount
|
mounts: buildCacheProdMount
|
||||||
}
|
}
|
||||||
|
|
||||||
assetsDigest: engine.#Exec & {
|
assetsDigest: dagger.#Exec & {
|
||||||
input: assetsCompile.output
|
input: assetsCompile.output
|
||||||
mounts: depsCacheMount & buildCacheProdMount & nodeModulesCacheMount
|
mounts: depsCacheMount & buildCacheProdMount & nodeModulesCacheMount
|
||||||
env: MIX_ENV: "prod"
|
env: MIX_ENV: "prod"
|
||||||
@ -143,20 +142,20 @@ engine.#Plan & {
|
|||||||
args: ["bash", "-c", "mix phx.digest"]
|
args: ["bash", "-c", "mix phx.digest"]
|
||||||
}
|
}
|
||||||
|
|
||||||
imageProdCacheCopy: engine.#Exec & {
|
imageProdCacheCopy: dagger.#Exec & {
|
||||||
input: assetsDigest.output
|
input: assetsDigest.output
|
||||||
mounts: (depsCacheMount & {depsCache: dest: "/mnt/app/deps/"} )
|
mounts: (depsCacheMount & {depsCache: dest: "/mnt/app/deps/"} )
|
||||||
mounts: (buildCacheProdMount & {buildCacheProd: dest: "/mnt/app/_build/prod"} )
|
mounts: (buildCacheProdMount & {buildCacheProd: dest: "/mnt/app/_build/prod"} )
|
||||||
args: ["bash", "-c", "cp -Rp /mnt/app/deps/* /app/deps/ && cp -Rp /mnt/app/_build/prod/* /app/_build/prod/"]
|
args: ["bash", "-c", "cp -Rp /mnt/app/deps/* /app/deps/ && cp -Rp /mnt/app/_build/prod/* /app/_build/prod/"]
|
||||||
}
|
}
|
||||||
|
|
||||||
imageProdDockerCopy: engine.#Copy & {
|
imageProdDockerCopy: dagger.#Copy & {
|
||||||
input: imageProdCacheCopy.output
|
input: imageProdCacheCopy.output
|
||||||
source: root: inputs.directories.docker.contents
|
source: root: inputs.directories.docker.contents
|
||||||
dest: "/"
|
dest: "/"
|
||||||
}
|
}
|
||||||
|
|
||||||
imageProd: engine.#Build & {
|
imageProd: dagger.#Build & {
|
||||||
source: imageProdDockerCopy.output
|
source: imageProdDockerCopy.output
|
||||||
dockerfile: path: "/docker/Dockerfile.production"
|
dockerfile: path: "/docker/Dockerfile.production"
|
||||||
buildArg: {
|
buildArg: {
|
||||||
|
@ -19,7 +19,7 @@ actions: {
|
|||||||
// workdir: _
|
// workdir: _
|
||||||
// // FIXME: remove copy-pasta
|
// // FIXME: remove copy-pasta
|
||||||
// mounts: nodeModules: {
|
// mounts: nodeModules: {
|
||||||
// contents: engine.#CacheDir & {
|
// contents: dagger.#CacheDir & {
|
||||||
// // FIXME: do we need an ID here?
|
// // FIXME: do we need an ID here?
|
||||||
// id: "\(mix.app)_assets_node_modules"
|
// id: "\(mix.app)_assets_node_modules"
|
||||||
// // FIXME: does this command need write access to node_modules cache?
|
// // FIXME: does this command need write access to node_modules cache?
|
||||||
@ -55,7 +55,7 @@ actions: {
|
|||||||
// }
|
// }
|
||||||
// // FIXME: move this to a reusable def (yarn package? or private?)
|
// // FIXME: move this to a reusable def (yarn package? or private?)
|
||||||
// mounts: nodeModules: {
|
// mounts: nodeModules: {
|
||||||
// contents: engine.#CacheDir & {
|
// contents: dagger.#CacheDir & {
|
||||||
// // FIXME: do we need an ID here?
|
// // FIXME: do we need an ID here?
|
||||||
// id: "\(mix.app)_assets_node_modules"
|
// id: "\(mix.app)_assets_node_modules"
|
||||||
// // FIXME: will there be multiple writers?
|
// // FIXME: will there be multiple writers?
|
||||||
|
@ -2,7 +2,6 @@ package mix
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
)
|
)
|
||||||
@ -68,7 +67,7 @@ import (
|
|||||||
}
|
}
|
||||||
if cache.deps != null {
|
if cache.deps != null {
|
||||||
mounts: deps: {
|
mounts: deps: {
|
||||||
contents: engine.#CacheDir & {
|
contents: dagger.#CacheDir & {
|
||||||
id: "\(app.name)_deps"
|
id: "\(app.name)_deps"
|
||||||
concurrency: cache.deps
|
concurrency: cache.deps
|
||||||
}
|
}
|
||||||
@ -77,7 +76,7 @@ import (
|
|||||||
}
|
}
|
||||||
if cache.build != null {
|
if cache.build != null {
|
||||||
mounts: buildCache: {
|
mounts: buildCache: {
|
||||||
contents: engine.#CacheDir & {
|
contents: dagger.#CacheDir & {
|
||||||
id: "\(app.name)_build_\(env)"
|
id: "\(app.name)_build_\(env)"
|
||||||
concurrency: cache.build
|
concurrency: cache.build
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
package git
|
package git
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#Pull: engine.#GitPull
|
#Pull: dagger.#GitPull
|
||||||
#Push: engine.#GitPush
|
#Push: dagger.#GitPush
|
||||||
|
@ -4,7 +4,6 @@ package netlify
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/alpine"
|
"universe.dagger.io/alpine"
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
@ -61,7 +60,7 @@ import (
|
|||||||
container: bash.#Run & {
|
container: bash.#Run & {
|
||||||
input: *_build.output | docker.#Image
|
input: *_build.output | docker.#Image
|
||||||
script: {
|
script: {
|
||||||
_load: engine.#Source & {
|
_load: dagger.#Source & {
|
||||||
path: "."
|
path: "."
|
||||||
include: ["*.sh"]
|
include: ["*.sh"]
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package netlify
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
"universe.dagger.io/netlify"
|
"universe.dagger.io/netlify"
|
||||||
@ -29,8 +28,8 @@ dagger.#Plan & {
|
|||||||
|
|
||||||
marker: "hello world"
|
marker: "hello world"
|
||||||
|
|
||||||
data: engine.#WriteFile & {
|
data: dagger.#WriteFile & {
|
||||||
input: engine.#Scratch
|
input: dagger.#Scratch
|
||||||
path: "index.html"
|
path: "index.html"
|
||||||
contents: marker
|
contents: marker
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package yarn
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/docker"
|
"universe.dagger.io/docker"
|
||||||
"universe.dagger.io/yarn"
|
"universe.dagger.io/yarn"
|
||||||
@ -79,7 +78,7 @@ dagger.#Plan & {
|
|||||||
path: string
|
path: string
|
||||||
contents: string
|
contents: string
|
||||||
|
|
||||||
_read: engine.#ReadFile & {
|
_read: dagger.#ReadFile & {
|
||||||
"input": input
|
"input": input
|
||||||
"path": path
|
"path": path
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
|
|
||||||
"universe.dagger.io/alpine"
|
"universe.dagger.io/alpine"
|
||||||
"universe.dagger.io/bash"
|
"universe.dagger.io/bash"
|
||||||
@ -77,7 +76,7 @@ import (
|
|||||||
mounts: {
|
mounts: {
|
||||||
"yarn cache": {
|
"yarn cache": {
|
||||||
dest: "/cache/yarn"
|
dest: "/cache/yarn"
|
||||||
contents: engine.#CacheDir & {
|
contents: dagger.#CacheDir & {
|
||||||
// FIXME: are there character limitations in cache ID?
|
// FIXME: are there character limitations in cache ID?
|
||||||
id: "universe.dagger.io/yarn.#Build \(name)"
|
id: "universe.dagger.io/yarn.#Build \(name)"
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ var (
|
|||||||
typePath = cue.MakePath(
|
typePath = cue.MakePath(
|
||||||
cue.Str("$dagger"),
|
cue.Str("$dagger"),
|
||||||
cue.Str("task"),
|
cue.Str("task"),
|
||||||
cue.Hid("_name", pkg.EnginePackage))
|
cue.Hid("_name", pkg.DaggerPackage))
|
||||||
)
|
)
|
||||||
|
|
||||||
type NewFunc func() Task
|
type NewFunc func() Task
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
fsIDPath = cue.MakePath(
|
fsIDPath = cue.MakePath(
|
||||||
cue.Str("$dagger"),
|
cue.Str("$dagger"),
|
||||||
cue.Str("fs"),
|
cue.Str("fs"),
|
||||||
cue.Hid("_id", pkg.EnginePackage),
|
cue.Hid("_id", pkg.DaggerPackage),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ var (
|
|||||||
secretIDPath = cue.MakePath(
|
secretIDPath = cue.MakePath(
|
||||||
cue.Str("$dagger"),
|
cue.Str("$dagger"),
|
||||||
cue.Str("secret"),
|
cue.Str("secret"),
|
||||||
cue.Hid("_id", pkg.EnginePackage),
|
cue.Hid("_id", pkg.DaggerPackage),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ var (
|
|||||||
serviceIDPath = cue.MakePath(
|
serviceIDPath = cue.MakePath(
|
||||||
cue.Str("$dagger"),
|
cue.Str("$dagger"),
|
||||||
cue.Str("service"),
|
cue.Str("service"),
|
||||||
cue.Hid("_id", pkg.EnginePackage),
|
cue.Hid("_id", pkg.DaggerPackage),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
# dagger universe
|
# dagger universe
|
||||||
alpha.dagger.io
|
alpha.dagger.io
|
||||||
|
dagger.io
|
||||||
|
universe.dagger.io
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
# dagger universe
|
# dagger universe
|
||||||
alpha.dagger.io
|
alpha.dagger.io
|
||||||
|
dagger.io
|
||||||
|
universe.dagger.io
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
# dagger universe
|
# dagger universe
|
||||||
alpha.dagger.io
|
alpha.dagger.io
|
||||||
|
dagger.io
|
||||||
|
universe.dagger.io
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
"alpha.dagger.io/os"
|
"alpha.dagger.io/os"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
sayHello: os.#Container & {
|
sayHello: os.#Container & {
|
||||||
command: "echo Hello Europa! > /out.txt"
|
command: "echo Hello Europa! > /out.txt"
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: test: path: "."
|
inputs: directories: test: path: "."
|
||||||
actions: verify: engine.#ReadFile & {
|
actions: verify: dagger.#ReadFile & {
|
||||||
input: inputs.directories.test.contents
|
input: inputs.directories.test.contents
|
||||||
path: "test.txt"
|
path: "test.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: test: path: "."
|
inputs: directories: test: path: "."
|
||||||
actions: verify: engine.#ReadFile & {
|
actions: verify: dagger.#ReadFile & {
|
||||||
input: inputs.directories.test.contents
|
input: inputs.directories.test.contents
|
||||||
path: "test.txt"
|
path: "test.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
// should fail because path does not exist locally
|
// should fail because path does not exist locally
|
||||||
inputs: directories: test: path: "./fasdfsdfs"
|
inputs: directories: test: path: "./fasdfsdfs"
|
||||||
actions: verify: engine.#ReadFile & {
|
actions: verify: dagger.#ReadFile & {
|
||||||
input: inputs.directories.test.contents
|
input: inputs.directories.test.contents
|
||||||
path: "test.txt"
|
path: "test.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: secrets: echo: command: {
|
inputs: secrets: echo: command: {
|
||||||
name: "echo"
|
name: "echo"
|
||||||
args: ["hello europa"]
|
args: ["hello europa"]
|
||||||
@ -12,11 +12,11 @@ engine.#Plan & {
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: secret: {
|
mounts: secret: {
|
||||||
dest: "/run/secrets/test"
|
dest: "/run/secrets/test"
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: secrets: echo: command: {
|
inputs: secrets: echo: command: {
|
||||||
name: "cat"
|
name: "cat"
|
||||||
args: ["./test.txt"]
|
args: ["./test.txt"]
|
||||||
@ -12,11 +12,11 @@ engine.#Plan & {
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: secret: {
|
mounts: secret: {
|
||||||
dest: "/run/secrets/test"
|
dest: "/run/secrets/test"
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: secrets: echo: command: {
|
inputs: secrets: echo: command: {
|
||||||
name: "rtyet" // should fail because command doesn't exist
|
name: "rtyet" // should fail because command doesn't exist
|
||||||
args: ["hello europa"]
|
args: ["hello europa"]
|
||||||
@ -12,11 +12,11 @@ engine.#Plan & {
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: secret: {
|
mounts: secret: {
|
||||||
dest: "/run/secrets/test"
|
dest: "/run/secrets/test"
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: secrets: echo: command: {
|
inputs: secrets: echo: command: {
|
||||||
name: "cat"
|
name: "cat"
|
||||||
args: ["--sfgjkhf"] // // should fail because invalid option
|
args: ["--sfgjkhf"] // // should fail because invalid option
|
||||||
@ -12,11 +11,11 @@ engine.#Plan & {
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: secret: {
|
mounts: secret: {
|
||||||
dest: "/run/secrets/test"
|
dest: "/run/secrets/test"
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "dagger.io/dagger/engine"
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: data: engine.#WriteFile & {
|
actions: data: dagger.#WriteFile & {
|
||||||
input: engine.#Scratch
|
input: dagger.#Scratch
|
||||||
path: "/test"
|
path: "/test"
|
||||||
permissions: 0o600
|
permissions: 0o600
|
||||||
contents: "foobar"
|
contents: "foobar"
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
platform: "linux/unknown"
|
platform: "linux/unknown"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0"
|
source: "alpine:3.15.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
writeArch: engine.#Exec & {
|
writeArch: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
always: true
|
always: true
|
||||||
args: [
|
args: [
|
||||||
@ -22,7 +21,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#ReadFile & {
|
verify: dagger.#ReadFile & {
|
||||||
input: writeArch.output
|
input: writeArch.output
|
||||||
path: "/arch.txt"
|
path: "/arch.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
platform: "linux/amd64"
|
platform: "linux/amd64"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0"
|
source: "alpine:3.15.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
writeArch: engine.#Exec & {
|
writeArch: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
always: true
|
always: true
|
||||||
args: [
|
args: [
|
||||||
@ -22,7 +21,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#ReadFile & {
|
verify: dagger.#ReadFile & {
|
||||||
input: writeArch.output
|
input: writeArch.output
|
||||||
path: "/arch.txt"
|
path: "/arch.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,18 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
platform: "linux/arm64"
|
platform: "linux/arm64"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0"
|
source: "alpine:3.15.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
writeArch: engine.#Exec & {
|
writeArch: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
always: true
|
always: true
|
||||||
args: [
|
args: [
|
||||||
@ -22,7 +21,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#ReadFile & {
|
verify: dagger.#ReadFile & {
|
||||||
input: writeArch.output
|
input: writeArch.output
|
||||||
path: "/arch.txt"
|
path: "/arch.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
|
|
||||||
"alpha.dagger.io/dagger/op"
|
"alpha.dagger.io/dagger/op"
|
||||||
"alpha.dagger.io/alpine"
|
"alpha.dagger.io/alpine"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
// should fail due to incomplete service
|
// should fail due to incomplete service
|
||||||
proxy: dockerSocket: {}
|
proxy: dockerSocket: {}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
"alpha.dagger.io/dagger/op"
|
"alpha.dagger.io/dagger/op"
|
||||||
"alpha.dagger.io/alpine"
|
"alpha.dagger.io/alpine"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
// should fail because incomplete value
|
// should fail because incomplete value
|
||||||
proxy: dockerSocket: unix: string
|
proxy: dockerSocket: unix: string
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
"alpha.dagger.io/dagger/op"
|
"alpha.dagger.io/dagger/op"
|
||||||
"alpha.dagger.io/alpine"
|
"alpha.dagger.io/alpine"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
// should fail because of misspelled key
|
// should fail because of misspelled key
|
||||||
proxy: dockerSocket: unx: "/var/run/docker.sock"
|
proxy: dockerSocket: unx: "/var/run/docker.sock"
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
"alpha.dagger.io/dagger/op"
|
"alpha.dagger.io/dagger/op"
|
||||||
"alpha.dagger.io/alpine"
|
"alpha.dagger.io/alpine"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
// should fail because of misspelled value
|
// should fail because of misspelled value
|
||||||
proxy: dockerSocket: unix: "/var/run/docker.soc"
|
proxy: dockerSocket: unix: "/var/run/docker.soc"
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
"alpha.dagger.io/dagger/op"
|
"alpha.dagger.io/dagger/op"
|
||||||
"alpha.dagger.io/alpine"
|
"alpha.dagger.io/alpine"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
// should succeed
|
// should succeed
|
||||||
proxy: dockerSocket: unix: "/var/run/docker.sock"
|
proxy: dockerSocket: unix: "/var/run/docker.sock"
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
env: FOO: string
|
env: FOO: string
|
||||||
args: [
|
args: [
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: params: foo: string
|
inputs: params: foo: string
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
env: FOO: inputs.params.foo
|
env: FOO: inputs.params.foo
|
||||||
args: [
|
args: [
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
exec: engine.#Exec & {
|
exec: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
args: [
|
args: [
|
||||||
"sh", "-c",
|
"sh", "-c",
|
||||||
@ -20,7 +20,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_file: engine.#ReadFile & {
|
verify_file: dagger.#ReadFile & {
|
||||||
input: exec.output
|
input: exec.output
|
||||||
path: "/output.txt"
|
path: "/output.txt"
|
||||||
} & {
|
} & {
|
||||||
@ -28,14 +28,14 @@ engine.#Plan & {
|
|||||||
contents: "hello world"
|
contents: "hello world"
|
||||||
}
|
}
|
||||||
|
|
||||||
copy: engine.#Copy & {
|
copy: dagger.#Copy & {
|
||||||
input: image.output
|
input: image.output
|
||||||
contents: exec.output
|
contents: exec.output
|
||||||
source: "/output.txt"
|
source: "/output.txt"
|
||||||
dest: "/output.txt"
|
dest: "/output.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_copy: engine.#ReadFile & {
|
verify_copy: dagger.#ReadFile & {
|
||||||
input: copy.output
|
input: copy.output
|
||||||
path: "/output.txt"
|
path: "/output.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
exec: engine.#Exec & {
|
exec: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
args: [
|
args: [
|
||||||
"sh", "-c",
|
"sh", "-c",
|
||||||
@ -20,7 +20,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_file: engine.#ReadFile & {
|
verify_file: dagger.#ReadFile & {
|
||||||
input: exec.output
|
input: exec.output
|
||||||
path: "/output.txt"
|
path: "/output.txt"
|
||||||
} & {
|
} & {
|
||||||
@ -28,13 +28,13 @@ engine.#Plan & {
|
|||||||
contents: "hello world from dagger"
|
contents: "hello world from dagger"
|
||||||
}
|
}
|
||||||
|
|
||||||
copy: engine.#Copy & {
|
copy: dagger.#Copy & {
|
||||||
input: image.output
|
input: image.output
|
||||||
contents: exec.output
|
contents: exec.output
|
||||||
source: "/output.txt"
|
source: "/output.txt"
|
||||||
dest: "/output.txt"
|
dest: "/output.txt"
|
||||||
}
|
}
|
||||||
verify_copy: engine.#ReadFile & {
|
verify_copy: dagger.#ReadFile & {
|
||||||
input: copy.output
|
input: copy.output
|
||||||
path: "/output.txt"
|
path: "/output.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
alpine3_15_0: engine.#Pull & {
|
alpine3_15_0: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
busybox1_34_1: engine.#Pull & {
|
busybox1_34_1: dagger.#Pull & {
|
||||||
source: "busybox:1.34.1-glibc@sha256:ec98391b8f0911db08be2ee6c46813eeac17b9625b402ea1ce45dcfcd05d78d6"
|
source: "busybox:1.34.1-glibc@sha256:ec98391b8f0911db08be2ee6c46813eeac17b9625b402ea1ce45dcfcd05d78d6"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_alpine_3_15_0: engine.#ReadFile & {
|
verify_alpine_3_15_0: dagger.#ReadFile & {
|
||||||
input: alpine3_15_0.output
|
input: alpine3_15_0.output
|
||||||
path: "/etc/alpine-release"
|
path: "/etc/alpine-release"
|
||||||
} & {
|
} & {
|
||||||
@ -22,14 +22,14 @@ engine.#Plan & {
|
|||||||
contents: "3.15.0\n"
|
contents: "3.15.0\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
copy: engine.#Copy & {
|
copy: dagger.#Copy & {
|
||||||
input: busybox1_34_1.output
|
input: busybox1_34_1.output
|
||||||
contents: alpine3_15_0.output
|
contents: alpine3_15_0.output
|
||||||
source: "/etc/alpine-release"
|
source: "/etc/alpine-release"
|
||||||
dest: "/alpine3_15_0_release"
|
dest: "/alpine3_15_0_release"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify_copy: engine.#ReadFile & {
|
verify_copy: dagger.#ReadFile & {
|
||||||
input: copy.output
|
input: copy.output
|
||||||
path: "/alpine3_15_0_release"
|
path: "/alpine3_15_0_release"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: testdata: path: "./testdata"
|
inputs: directories: testdata: path: "./testdata"
|
||||||
|
|
||||||
actions: build: engine.#Dockerfile & {
|
actions: build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
dockerfile: contents: """
|
dockerfile: contents: """
|
||||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||||
|
@ -2,10 +2,9 @@ package testing
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: {
|
inputs: {
|
||||||
directories: testdata: path: "./testdata"
|
directories: testdata: path: "./testdata"
|
||||||
secrets: sops: command: {
|
secrets: sops: command: {
|
||||||
@ -20,7 +19,7 @@ engine.#Plan & {
|
|||||||
input: inputs.secrets.sops.contents
|
input: inputs.secrets.sops.contents
|
||||||
}
|
}
|
||||||
|
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
auth: "daggerio/ci-test:private-pull": {
|
auth: "daggerio/ci-test:private-pull": {
|
||||||
username: "daggertest"
|
username: "daggertest"
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: testdata: path: "./testdata"
|
inputs: directories: testdata: path: "./testdata"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: build.output
|
input: build.output
|
||||||
args: ["sh", "-c", "test $(cat /dir/foo) = foobar"]
|
args: ["sh", "-c", "test $(cat /dir/foo) = foobar"]
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: testdata: path: "./testdata"
|
inputs: directories: testdata: path: "./testdata"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
dockerfile: path: "./dockerfilepath/Dockerfile.custom"
|
dockerfile: path: "./dockerfilepath/Dockerfile.custom"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: build.output
|
input: build.output
|
||||||
args: ["sh", "-c", "test $(cat /test) = dockerfilePath"]
|
args: ["sh", "-c", "test $(cat /test) = dockerfilePath"]
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: testdata: path: "./testdata"
|
inputs: directories: testdata: path: "./testdata"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
// FIXME: this doesn't test anything beside not crashing
|
// FIXME: this doesn't test anything beside not crashing
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
dockerfile: contents: """
|
dockerfile: contents: """
|
||||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: testdata: path: "./testdata"
|
inputs: directories: testdata: path: "./testdata"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
dockerfile: contents: """
|
dockerfile: contents: """
|
||||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||||
@ -16,7 +16,7 @@ engine.#Plan & {
|
|||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: build.output
|
input: build.output
|
||||||
args: ["sh", "-c", "test $(cat /output) = foobar"]
|
args: ["sh", "-c", "test $(cat /output) = foobar"]
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: testdata: path: "./testdata"
|
inputs: directories: testdata: path: "./testdata"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
dockerfile: contents: """
|
dockerfile: contents: """
|
||||||
# syntax = docker/dockerfile:1.3
|
# syntax = docker/dockerfile:1.3
|
||||||
@ -17,7 +17,7 @@ engine.#Plan & {
|
|||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: build.output
|
input: build.output
|
||||||
args: ["sh", "-c", "test $(cat /output) = foobar"]
|
args: ["sh", "-c", "test $(cat /output) = foobar"]
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: testdata: path: "./testdata"
|
inputs: directories: testdata: path: "./testdata"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
// FIXME: this doesn't test anything beside not crashing
|
// FIXME: this doesn't test anything beside not crashing
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
dockerfile: contents: """
|
dockerfile: contents: """
|
||||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: directories: testdata: path: "./testdata"
|
inputs: directories: testdata: path: "./testdata"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
// FIXME: this doesn't test anything beside not crashing
|
// FIXME: this doesn't test anything beside not crashing
|
||||||
build: engine.#Dockerfile & {
|
build: dagger.#Dockerfile & {
|
||||||
source: inputs.directories.testdata.contents
|
source: inputs.directories.testdata.contents
|
||||||
dockerfile: contents: """
|
dockerfile: contents: """
|
||||||
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
exec: engine.#Exec & {
|
exec: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
args: ["sh", "-c", "echo -n hello world > /output.txt"]
|
args: ["sh", "-c", "echo -n hello world > /output.txt"]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#ReadFile & {
|
verify: dagger.#ReadFile & {
|
||||||
input: exec.output
|
input: exec.output
|
||||||
path: "/output.txt"
|
path: "/output.txt"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
env: TEST: "hello world"
|
env: TEST: "hello world"
|
||||||
args: [
|
args: [
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: secrets: testSecret: path: "secret.txt"
|
inputs: secrets: testSecret: path: "secret.txt"
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
env: TEST: inputs.secrets.testSecret.contents
|
env: TEST: inputs.secrets.testSecret.contents
|
||||||
args: [
|
args: [
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
hosts: "unit.test": "1.2.3.4"
|
hosts: "unit.test": "1.2.3.4"
|
||||||
args: [
|
args: [
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
sharedCache: engine.#CacheDir & {
|
sharedCache: dagger.#CacheDir & {
|
||||||
id: "mycache"
|
id: "mycache"
|
||||||
}
|
}
|
||||||
|
|
||||||
exec: engine.#Exec & {
|
exec: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: cache: {
|
mounts: cache: {
|
||||||
dest: "/cache"
|
dest: "/cache"
|
||||||
@ -28,7 +28,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: cache: {
|
mounts: cache: {
|
||||||
dest: "/cache"
|
dest: "/cache"
|
||||||
@ -43,10 +43,10 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
otherCache: engine.#CacheDir & {
|
otherCache: dagger.#CacheDir & {
|
||||||
id: "othercache"
|
id: "othercache"
|
||||||
}
|
}
|
||||||
verifyOtherCache: engine.#Exec & {
|
verifyOtherCache: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: cache: {
|
mounts: cache: {
|
||||||
dest: "/cache"
|
dest: "/cache"
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
exec: engine.#Exec & {
|
exec: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
args: [
|
args: [
|
||||||
"sh", "-c",
|
"sh", "-c",
|
||||||
@ -20,7 +20,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: fs: {
|
mounts: fs: {
|
||||||
dest: "/target"
|
dest: "/target"
|
||||||
@ -35,7 +35,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verifyRO: engine.#Exec & {
|
verifyRO: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: fs: {
|
mounts: fs: {
|
||||||
dest: "/target"
|
dest: "/target"
|
||||||
@ -53,7 +53,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verifySource: engine.#Exec & {
|
verifySource: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: fs: {
|
mounts: fs: {
|
||||||
dest: "/target.txt"
|
dest: "/target.txt"
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: secrets: testSecret: envvar: "TESTSECRET"
|
inputs: secrets: testSecret: envvar: "TESTSECRET"
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: secret: {
|
mounts: secret: {
|
||||||
dest: "/run/secrets/test"
|
dest: "/run/secrets/test"
|
||||||
@ -26,7 +26,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verifyPerm: engine.#Exec & {
|
verifyPerm: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: secret: {
|
mounts: secret: {
|
||||||
dest: "/run/secrets/test"
|
dest: "/run/secrets/test"
|
||||||
|
@ -1,23 +1,23 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
proxy: dockerSocket: unix: "/var/run/docker.sock"
|
proxy: dockerSocket: unix: "/var/run/docker.sock"
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
imageWithDocker: engine.#Exec & {
|
imageWithDocker: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
args: ["apk", "add", "--no-cache", "docker-cli"]
|
args: ["apk", "add", "--no-cache", "docker-cli"]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: imageWithDocker.output
|
input: imageWithDocker.output
|
||||||
mounts: docker: {
|
mounts: docker: {
|
||||||
dest: "/var/run/docker.sock"
|
dest: "/var/run/docker.sock"
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
exec: engine.#Exec & {
|
exec: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: temp: {
|
mounts: temp: {
|
||||||
dest: "/temp"
|
dest: "/temp"
|
||||||
contents: engine.#TempDir
|
contents: dagger.#TempDir
|
||||||
}
|
}
|
||||||
args: [
|
args: [
|
||||||
"sh", "-c",
|
"sh", "-c",
|
||||||
@ -24,7 +24,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: exec.output
|
input: exec.output
|
||||||
args: [
|
args: [
|
||||||
"sh", "-c",
|
"sh", "-c",
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
addUser: engine.#Exec & {
|
addUser: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
args: ["adduser", "-D", "test"]
|
args: ["adduser", "-D", "test"]
|
||||||
}
|
}
|
||||||
|
|
||||||
verifyUsername: engine.#Exec & {
|
verifyUsername: dagger.#Exec & {
|
||||||
input: addUser.output
|
input: addUser.output
|
||||||
user: "test"
|
user: "test"
|
||||||
args: [
|
args: [
|
||||||
@ -26,7 +26,7 @@ engine.#Plan & {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
verifyUserID: engine.#Exec & {
|
verifyUserID: dagger.#Exec & {
|
||||||
input: addUser.output
|
input: addUser.output
|
||||||
user: "1000"
|
user: "1000"
|
||||||
args: [
|
args: [
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
workdir: "/tmp"
|
workdir: "/tmp"
|
||||||
args: [
|
args: [
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "dagger.io/dagger/engine"
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: badref: engine.#GitPull & {
|
actions: badref: dagger.#GitPull & {
|
||||||
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
||||||
ref: "lalalalal"
|
ref: "lalalalal"
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "dagger.io/dagger/engine"
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: badremote: engine.#GitPull & {
|
actions: badremote: dagger.#GitPull & {
|
||||||
remote: "https://github.com/blocklayerhq/lalalala.git"
|
remote: "https://github.com/blocklayerhq/lalalala.git"
|
||||||
ref: "master"
|
ref: "master"
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "dagger.io/dagger/engine"
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: gitPull: engine.#GitPull & {
|
actions: gitPull: dagger.#GitPull & {
|
||||||
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
||||||
ref: "master"
|
ref: "master"
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
package testing
|
package testing
|
||||||
|
|
||||||
import "dagger.io/dagger/engine"
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
repo1: engine.#GitPull & {
|
repo1: dagger.#GitPull & {
|
||||||
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
||||||
ref: "master"
|
ref: "master"
|
||||||
}
|
}
|
||||||
|
|
||||||
repo2: engine.#GitPull & {
|
repo2: dagger.#GitPull & {
|
||||||
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
remote: "https://github.com/blocklayerhq/acme-clothing.git"
|
||||||
ref: "master"
|
ref: "master"
|
||||||
keepGitDir: true
|
keepGitDir: true
|
||||||
}
|
}
|
||||||
|
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0"
|
source: "alpine:3.15.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
args: ["sh", "-c", """
|
args: ["sh", "-c", """
|
||||||
set -eu
|
set -eu
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "dagger.io/dagger/engine"
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: invalid: engine.#GitPull & {}
|
actions: invalid: dagger.#GitPull & {}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,9 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger"
|
"dagger.io/dagger"
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
inputs: secrets: sops: command: {
|
inputs: secrets: sops: command: {
|
||||||
name: "sops"
|
name: "sops"
|
||||||
args: ["-d", "../../secrets_sops.yaml"]
|
args: ["-d", "../../secrets_sops.yaml"]
|
||||||
@ -13,7 +12,7 @@ engine.#Plan & {
|
|||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
||||||
alpine: engine.#Pull & {
|
alpine: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0"
|
source: "alpine:3.15.0"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -22,7 +21,7 @@ engine.#Plan & {
|
|||||||
input: inputs.secrets.sops.contents
|
input: inputs.secrets.sops.contents
|
||||||
}
|
}
|
||||||
|
|
||||||
testRepo: engine.#GitPull & {
|
testRepo: dagger.#GitPull & {
|
||||||
remote: "https://github.com/dagger/dagger.git"
|
remote: "https://github.com/dagger/dagger.git"
|
||||||
ref: "main"
|
ref: "main"
|
||||||
auth: {
|
auth: {
|
||||||
@ -31,7 +30,7 @@ engine.#Plan & {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
testContent: engine.#Exec & {
|
testContent: dagger.#Exec & {
|
||||||
input: alpine.output
|
input: alpine.output
|
||||||
always: true
|
always: true
|
||||||
args: ["ls", "-l", "/repo/README.md"]
|
args: ["ls", "-l", "/repo/README.md"]
|
||||||
|
@ -1,20 +1,19 @@
|
|||||||
package hidden
|
package hidden
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#Hidden: {
|
#Hidden: {
|
||||||
_pull: engine.#Pull & {
|
_pull: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
_write: engine.#WriteFile & {
|
_write: dagger.#WriteFile & {
|
||||||
input: _pull.output
|
input: _pull.output
|
||||||
path: "/testing"
|
path: "/testing"
|
||||||
contents: "1,2,3"
|
contents: "1,2,3"
|
||||||
permissions: 700
|
permissions: 700
|
||||||
}
|
}
|
||||||
_readfile: engine.#ReadFile & {
|
_readfile: dagger.#ReadFile & {
|
||||||
input: _write.output
|
input: _write.output
|
||||||
path: "/testing"
|
path: "/testing"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
"testing.dagger.io/hidden"
|
"testing.dagger.io/hidden"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
pull: engine.#Pull & {
|
pull: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
_write: engine.#WriteFile & {
|
_write: dagger.#WriteFile & {
|
||||||
input: pull.output
|
input: pull.output
|
||||||
path: "/testing"
|
path: "/testing"
|
||||||
contents: "1,2,3"
|
contents: "1,2,3"
|
||||||
permissions: 700
|
permissions: 700
|
||||||
}
|
}
|
||||||
readfile: engine.#ReadFile & {
|
readfile: dagger.#ReadFile & {
|
||||||
input: _write.output
|
input: _write.output
|
||||||
path: "/testing"
|
path: "/testing"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "dagger.io/dagger/engine"
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: fetch: engine.#HTTPFetch & {
|
actions: fetch: dagger.#HTTPFetch & {
|
||||||
source: "https://releases.dagger.io/dagger/latest_version"
|
source: "https://releases.dagger.io/dagger/latest_version"
|
||||||
dest: "/latest.html"
|
dest: "/latest.html"
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "dagger.io/dagger/engine"
|
import (
|
||||||
|
"dagger.io/dagger"
|
||||||
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: fetch: engine.#HTTPFetch & {
|
actions: fetch: dagger.#HTTPFetch & {
|
||||||
source: "https://releases.dagger.io/dagger/asfgdsfg"
|
source: "https://releases.dagger.io/dagger/asfgdsfg"
|
||||||
dest: "/latest.html"
|
dest: "/latest.html"
|
||||||
}
|
}
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir: engine.#Mkdir & {
|
mkdir: dagger.#Mkdir & {
|
||||||
input: image.output
|
input: image.output
|
||||||
path: "/test"
|
path: "/test"
|
||||||
}
|
}
|
||||||
|
|
||||||
writeChecker: engine.#WriteFile & {
|
writeChecker: dagger.#WriteFile & {
|
||||||
input: mkdir.output
|
input: mkdir.output
|
||||||
path: "/test/foo"
|
path: "/test/foo"
|
||||||
contents: "bar"
|
contents: "bar"
|
||||||
permissions: 700
|
permissions: 700
|
||||||
}
|
}
|
||||||
|
|
||||||
readChecker: engine.#ReadFile & {
|
readChecker: dagger.#ReadFile & {
|
||||||
input: writeChecker.output
|
input: writeChecker.output
|
||||||
path: "/test/foo"
|
path: "/test/foo"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir: engine.#Mkdir & {
|
mkdir: dagger.#Mkdir & {
|
||||||
input: image.output
|
input: image.output
|
||||||
path: "/test/baz"
|
path: "/test/baz"
|
||||||
parents: false
|
parents: false
|
||||||
}
|
}
|
||||||
|
|
||||||
writeChecker: engine.#WriteFile & {
|
writeChecker: dagger.#WriteFile & {
|
||||||
input: mkdir.output
|
input: mkdir.output
|
||||||
path: "/test/baz/foo"
|
path: "/test/baz/foo"
|
||||||
contents: "bar"
|
contents: "bar"
|
||||||
permissions: 700
|
permissions: 700
|
||||||
}
|
}
|
||||||
|
|
||||||
readChecker: engine.#ReadFile & {
|
readChecker: dagger.#ReadFile & {
|
||||||
input: writeChecker.output
|
input: writeChecker.output
|
||||||
path: "/test/baz/foo"
|
path: "/test/baz/foo"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir: engine.#Mkdir & {
|
mkdir: dagger.#Mkdir & {
|
||||||
input: image.output
|
input: image.output
|
||||||
path: "/test/baz"
|
path: "/test/baz"
|
||||||
}
|
}
|
||||||
|
|
||||||
writeChecker: engine.#WriteFile & {
|
writeChecker: dagger.#WriteFile & {
|
||||||
input: mkdir.output
|
input: mkdir.output
|
||||||
path: "/test/baz/foo"
|
path: "/test/baz/foo"
|
||||||
contents: "bar"
|
contents: "bar"
|
||||||
permissions: 700
|
permissions: 700
|
||||||
}
|
}
|
||||||
|
|
||||||
readChecker: engine.#ReadFile & {
|
readChecker: dagger.#ReadFile & {
|
||||||
input: writeChecker.output
|
input: writeChecker.output
|
||||||
path: "/test/baz/foo"
|
path: "/test/baz/foo"
|
||||||
} & {
|
} & {
|
||||||
|
@ -1,26 +1,26 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"dagger.io/dagger/engine"
|
"dagger.io/dagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
engine.#Plan & {
|
dagger.#Plan & {
|
||||||
actions: {
|
actions: {
|
||||||
image: engine.#Pull & {
|
image: dagger.#Pull & {
|
||||||
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
|
||||||
}
|
}
|
||||||
|
|
||||||
generate: engine.#Exec & {
|
generate: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
args: ["sh", "-c", "echo test > /secret"]
|
args: ["sh", "-c", "echo test > /secret"]
|
||||||
}
|
}
|
||||||
|
|
||||||
load: engine.#NewSecret & {
|
load: dagger.#NewSecret & {
|
||||||
input: generate.output
|
input: generate.output
|
||||||
path: "/secret"
|
path: "/secret"
|
||||||
}
|
}
|
||||||
|
|
||||||
verify: engine.#Exec & {
|
verify: dagger.#Exec & {
|
||||||
input: image.output
|
input: image.output
|
||||||
mounts: secret: {
|
mounts: secret: {
|
||||||
dest: "/run/secrets/test"
|
dest: "/run/secrets/test"
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user