Move core actions to a subpackage

Signed-off-by: Helder Correia <174525+helderco@users.noreply.github.com>
This commit is contained in:
Helder Correia 2022-03-26 14:09:21 -01:00
parent 9f042800da
commit b3bdd347e7
No known key found for this signature in database
GPG Key ID: C6490D872EF1DCA7
121 changed files with 469 additions and 340 deletions

View File

@ -2,12 +2,13 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"universe.dagger.io/docker"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "./src": read: contents: dagger.#FS client: filesystem: "./src": read: contents: dagger.#FS
actions: build: dagger.#Dockerfile & { actions: build: docker.#Dockerfile & {
// This is the context. // This is the context.
source: client.filesystem."./src".read.contents source: client.filesystem."./src".read.contents

View File

@ -23,7 +23,7 @@ dagger.#Plan & {
run: bash.#Run & { run: bash.#Run & {
// ... // ...
} }
contents: dagger.#Subdir & { contents: core.#Subdir & {
// ... // ...
} }
} }

View File

@ -5,7 +5,7 @@ dagger.#Plan & {
contents: dagger.#Secret contents: dagger.#Secret
} }
actions: { actions: {
registry: dagger.#TrimSecret & { registry: core.#TrimSecret & {
input: client.filesystem.".registry".read.contents input: client.filesystem.".registry".read.contents
} }
pull: docker.#Pull & { pull: docker.#Pull & {

View File

@ -7,7 +7,7 @@ dagger.#Plan & {
actions: { actions: {
// Makes the yaml keys easily accessible // Makes the yaml keys easily accessible
secrets: dagger.#DecodeSecret & { secrets: core.#DecodeSecret & {
input: client.commands.sops.stdout input: client.commands.sops.stdout
format: "yaml" format: "yaml"
} }

View File

@ -28,6 +28,7 @@ package particubes
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
) )
@ -63,7 +64,7 @@ dagger.#Plan & {
image: build.output image: build.output
} }
docsSecrets: dagger.#DecodeSecret & { docsSecrets: core.#DecodeSecret & {
input: inputs.secrets.docs.contents input: inputs.secrets.docs.contents
format: "yaml" format: "yaml"
} }

View File

@ -1,4 +1,4 @@
package dagger package core
// Execute a command in a container // Execute a command in a container
#Exec: { #Exec: {

View File

@ -1,4 +1,4 @@
package dagger package core
// 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

View File

@ -1,4 +1,4 @@
package dagger package core
// Push a directory to a git remote // Push a directory to a git remote
#GitPush: { #GitPush: {
@ -11,7 +11,7 @@ package dagger
} }
// Pull a directory from a git remote // Pull a directory from a git remote
// Warning: do NOT embed credentials in the remote url as this will expose them in logs. // Warning: do NOT embed credentials in the remote url as this will expose them in logs.
// By using username and password Dagger will handle this for you in a secure manner. // By using username and password Dagger will handle this for you in a secure manner.
#GitPull: { #GitPull: {
$dagger: task: _name: "GitPull" $dagger: task: _name: "GitPull"

View File

@ -1,4 +1,4 @@
package dagger package core
// HTTP operations // HTTP operations

View File

@ -1,31 +1,6 @@
package dagger package core
import ( import "list"
"list"
)
// Upload a container image to a remote repository
#Push: {
$dagger: task: _name: "Push"
// Target repository address
dest: #Ref
// Filesystem contents to push
input: #FS
// Container image config
config: #ImageConfig
// Authentication
auth?: {
username: string
secret: #Secret
}
// Complete ref of the pushed image, including digest
result: #Ref
}
// A ref is an address for a remote container image // A ref is an address for a remote container image
// //
@ -62,6 +37,29 @@ import (
retries?: int retries?: int
} }
// Upload a container image to a remote repository
#Push: {
$dagger: task: _name: "Push"
// Target repository address
dest: #Ref
// Filesystem contents to push
input: #FS
// Container image config
config: #ImageConfig
// Authentication
auth?: {
username: string
secret: #Secret
}
// Complete ref of the pushed image, including digest
result: #Ref
}
// Download a container image from a remote repository // Download a container image from a remote repository
#Pull: { #Pull: {
$dagger: task: _name: "Pull" $dagger: task: _name: "Pull"

View File

@ -1,4 +1,4 @@
package dagger package core
// A core action that does nothing // A core action that does nothing
// Useful to work around bugs in the DAG resolver. // Useful to work around bugs in the DAG resolver.

View File

@ -1,4 +1,4 @@
package dagger package core
// A special kind of program which `dagger` can execute. // A special kind of program which `dagger` can execute.
#Plan: { #Plan: {

View File

@ -1,4 +1,4 @@
package dagger package core
// Decode the contents of a secrets without leaking it. // Decode the contents of a secrets without leaking it.
// Supported formats: json, yaml // Supported formats: json, yaml

View File

@ -1,4 +1,4 @@
package dagger package core
// A reference to a filesystem tree. // A reference to a filesystem tree.
// For example: // For example:

View File

@ -0,0 +1,26 @@
package dagger
import "dagger.io/dagger/core"
#Plan: core.#Plan
// Types
#FS: core.#FS
#Scratch: core.#Scratch
#Secret: core.#Secret
#Service: core.#Service
#Address: core.#Address
// Image
#Ref: core.#Ref
#ImageConfig: core.#ImageConfig
#HealthCheck: core.#HealthCheck
// Mounts
#CacheDir: core.#CacheDir
#TempDir: core.#TempDir

View File

@ -31,7 +31,7 @@ var (
UniverseModule, UniverseModule,
} }
DaggerPackage = fmt.Sprintf("%s/dagger", DaggerModule) DaggerPackage = fmt.Sprintf("%s/dagger/core", DaggerModule)
lockFilePath = "dagger.lock" lockFilePath = "dagger.lock"
) )

View File

@ -2,6 +2,7 @@ package alpine
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/alpine" "universe.dagger.io/alpine"
"universe.dagger.io/docker" "universe.dagger.io/docker"
@ -16,7 +17,7 @@ dagger.#Plan & {
version: "3.10.9" version: "3.10.9"
} }
verify: dagger.#Readfile & { verify: core.#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"

View File

@ -3,13 +3,14 @@ package aws
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
) )
#DefaultLinuxVersion: "amazonlinux:2.0.20220121.0@sha256:f3a37f84f2644095e2c6f6fdf2bf4dbf68d5436c51afcfbfa747a5de391d5d62" #DefaultLinuxVersion: "amazonlinux:2.0.20220121.0@sha256:f3a37f84f2644095e2c6f6fdf2bf4dbf68d5436c51afcfbfa747a5de391d5d62"
#DefaultCliVersion: "2.4.12" #DefaultCliVersion: "2.4.12"
// Build provides a docker.#Image with the aws cli pre-installed to Amazon Linux 2. // Build provides a docker.#Image with the aws cli pre-installed to Amazon Linux 2.
// Can be customized with packages, and can be used with docker.#Run for executing custom scripts. // Can be customized with packages, and can be used with docker.#Run for executing custom scripts.
// Used by default with aws.#Run // Used by default with aws.#Run
#Build: { #Build: {
@ -39,7 +40,7 @@ import (
] ]
} }
_scripts: dagger.#Source & { _scripts: core.#Source & {
path: "_scripts" path: "_scripts"
} }

View File

@ -2,6 +2,7 @@ package test
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/aws" "universe.dagger.io/aws"
"universe.dagger.io/aws/cli" "universe.dagger.io/aws/cli"
) )
@ -14,7 +15,7 @@ dagger.#Plan & {
} }
actions: { actions: {
sopsSecrets: dagger.#DecodeSecret & { sopsSecrets: core.#DecodeSecret & {
format: "yaml" format: "yaml"
input: client.commands.sops.stdout input: client.commands.sops.stdout
} }

View File

@ -3,6 +3,7 @@ package test
import ( import (
"encoding/json" "encoding/json"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/aws" "universe.dagger.io/aws"
) )
@ -20,7 +21,7 @@ dagger.#Plan & {
} }
actions: { actions: {
sopsSecrets: dagger.#DecodeSecret & { sopsSecrets: core.#DecodeSecret & {
format: "yaml" format: "yaml"
input: client.commands.sops.stdout input: client.commands.sops.stdout
} }

View File

@ -3,6 +3,7 @@ package test
import ( import (
"encoding/json" "encoding/json"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/aws" "universe.dagger.io/aws"
) )
@ -14,7 +15,7 @@ dagger.#Plan & {
} }
actions: { actions: {
sopsSecrets: dagger.#DecodeSecret & { sopsSecrets: core.#DecodeSecret & {
format: "yaml" format: "yaml"
input: client.commands.sops.stdout input: client.commands.sops.stdout
} }

View File

@ -3,6 +3,7 @@ package bash
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
) )
@ -26,7 +27,7 @@ import (
contents: string contents: string
_filename: "run.sh" _filename: "run.sh"
_write: dagger.#WriteFile & { _write: core.#WriteFile & {
input: dagger.#Scratch input: dagger.#Scratch
path: _filename path: _filename
"contents": contents "contents": contents

View File

@ -2,6 +2,7 @@ package bash
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
"universe.dagger.io/bash" "universe.dagger.io/bash"
@ -19,7 +20,7 @@ dagger.#Plan & {
runFile: { runFile: {
dir: _load.output dir: _load.output
_load: dagger.#Source & { _load: core.#Source & {
path: "./data" path: "./data"
include: ["*.sh"] include: ["*.sh"]
} }

View File

@ -2,6 +2,7 @@ package docker
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
// Modular build API for Docker containers // Modular build API for Docker containers
@ -46,7 +47,7 @@ import (
dest: string | *"/" dest: string | *"/"
// Execute copy operation // Execute copy operation
_copy: dagger.#Copy & { _copy: core.#Copy & {
"input": input.rootfs "input": input.rootfs
"contents": contents "contents": contents
"source": source "source": source
@ -83,7 +84,7 @@ import (
label: [string]: string label: [string]: string
hosts: [string]: string hosts: [string]: string
_build: dagger.#Dockerfile & { _build: core.#Dockerfile & {
"source": source "source": source
"auth": auth "auth": auth
"dockerfile": dockerfile "dockerfile": dockerfile

View File

@ -1,7 +1,7 @@
package cli package cli
import ( import (
"dagger.io/dagger" "dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
) )
@ -19,7 +19,7 @@ import (
// Root filesystem with exported file // Root filesystem with exported file
result: _export.output result: _export.output
_export: dagger.#Export & { _export: core.#Export & {
"tag": tag "tag": tag
input: image.rootfs input: image.rootfs
config: image.config config: image.config

View File

@ -3,6 +3,7 @@ package docker
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
// Download an image from a remote registry // Download an image from a remote registry
@ -16,7 +17,7 @@ import (
secret: dagger.#Secret secret: dagger.#Secret
} }
_op: dagger.#Pull & { _op: core.#Pull & {
"source": source "source": source
if auth != _|_ { if auth != _|_ {
"auth": auth "auth": auth

View File

@ -2,6 +2,7 @@ package docker
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
// Upload an image to a remote repository // Upload an image to a remote repository
@ -21,7 +22,7 @@ import (
// Image to push // Image to push
image: #Image image: #Image
_push: dagger.#Push & { _push: core.#Push & {
"dest": dest "dest": dest
if auth != _|_ { if auth != _|_ {
"auth": auth "auth": auth

View File

@ -4,6 +4,7 @@ import (
"list" "list"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
// Run a command in a container // Run a command in a container
@ -14,7 +15,7 @@ import (
always: bool | *false always: bool | *false
// Filesystem mounts // Filesystem mounts
mounts: [name=string]: dagger.#Mount mounts: [name=string]: core.#Mount
// Expose network ports // Expose network ports
// FIXME: investigate feasibility // FIXME: investigate feasibility
@ -70,7 +71,7 @@ import (
// Add defaults to image config // Add defaults to image config
// This ensures these values are present // This ensures these values are present
_defaults: dagger.#Set & { _defaults: core.#Set & {
"input": { "input": {
entrypoint: [] entrypoint: []
cmd: [] cmd: []
@ -81,7 +82,7 @@ import (
} }
// Override with user config // Override with user config
_config: dagger.#Set & { _config: core.#Set & {
input: _defaults.output input: _defaults.output
config: { config: {
if entrypoint != _|_ { if entrypoint != _|_ {
@ -123,7 +124,7 @@ import (
for path, _ in files { for path, _ in files {
"\(path)": { "\(path)": {
contents: string & _read.contents contents: string & _read.contents
_read: dagger.#ReadFile & { _read: core.#ReadFile & {
input: _exec.output input: _exec.output
"path": path "path": path
} }
@ -139,7 +140,7 @@ import (
for path, _ in directories { for path, _ in directories {
"\(path)": { "\(path)": {
contents: dagger.#FS & _subdir.output contents: dagger.#FS & _subdir.output
_subdir: dagger.#Subdir & { _subdir: core.#Subdir & {
input: _exec.output input: _exec.output
"path": path "path": path
} }
@ -159,7 +160,7 @@ import (
} }
// Actually execute the command // Actually execute the command
_exec: dagger.#Exec & { _exec: core.#Exec & {
"input": input.rootfs "input": input.rootfs
"always": always "always": always
"mounts": mounts "mounts": mounts
@ -167,7 +168,7 @@ import (
workdir: _config.output.workdir workdir: _config.output.workdir
user: _config.output.user user: _config.output.user
"env": env "env": env
// env may contain secrets so we can't use dagger.#Set // env may contain secrets so we can't use core.#Set
if input.config.env != _|_ { if input.config.env != _|_ {
for key, val in input.config.env { for key, val in input.config.env {
if env[key] == _|_ { if env[key] == _|_ {

View File

@ -2,6 +2,7 @@ package docker
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
// Change image config // Change image config
@ -12,7 +13,7 @@ import (
// The image config to change // The image config to change
config: dagger.#ImageConfig config: dagger.#ImageConfig
_set: dagger.#Set & { _set: core.#Set & {
"input": input.config "input": input.config
"config": config "config": config
} }

View File

@ -2,6 +2,7 @@ package docker
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/alpine" "universe.dagger.io/alpine"
"universe.dagger.io/docker" "universe.dagger.io/docker"
@ -26,7 +27,7 @@ dagger.#Plan & {
] ]
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: image.output.rootfs input: image.output.rootfs
path: "/test.txt" path: "/test.txt"
} }
@ -59,7 +60,7 @@ dagger.#Plan & {
] ]
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: image.output.rootfs input: image.output.rootfs
path: "/test.txt" path: "/test.txt"
} }

View File

@ -2,6 +2,7 @@ package docker
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
) )
@ -16,7 +17,7 @@ dagger.#Plan & {
source: dagger.#Scratch source: dagger.#Scratch
dockerfile: contents: """ dockerfile: contents: """
FROM alpine:3.15 FROM alpine:3.15
RUN echo -n hello world >> /test.txt RUN echo -n hello world >> /test.txt
""" """
}, },
@ -33,7 +34,7 @@ dagger.#Plan & {
] ]
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: build.output.rootfs input: build.output.rootfs
path: "/test.txt" path: "/test.txt"
} & { } & {
@ -58,7 +59,7 @@ dagger.#Plan & {
] ]
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: build.output.rootfs input: build.output.rootfs
path: "/test.txt" path: "/test.txt"
} & { } & {

View File

@ -2,6 +2,7 @@ package docker
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
) )
@ -43,7 +44,7 @@ dagger.#Plan & {
// Test: image config behavior is correct // Test: image config behavior is correct
config: { config: {
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: dagger.#Scratch source: dagger.#Scratch
dockerfile: contents: """ dockerfile: contents: """
FROM alpine:3.15.0 FROM alpine:3.15.0
@ -71,7 +72,7 @@ dagger.#Plan & {
contents: """ contents: """
#!/bin/sh #!/bin/sh
echo -n "hello from $HELLO_FROM" > /dagger.txt echo -n "hello from $HELLO_FROM" > /dagger.txt
""" """
} }
} }

View File

@ -2,6 +2,7 @@ package docker
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
"universe.dagger.io/alpine" "universe.dagger.io/alpine"
@ -24,7 +25,7 @@ dagger.#Plan & {
} }
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: run.output.rootfs input: run.output.rootfs
path: "/output.txt" path: "/output.txt"
} }
@ -59,7 +60,7 @@ dagger.#Plan & {
export: directories: "/test": _ export: directories: "/test": _
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: run.export.directories."/test" input: run.export.directories."/test"
path: "/output.txt" path: "/output.txt"
} }

View File

@ -56,11 +56,11 @@ dagger.#Plan & {
} }
actions: { actions: {
runtimeImage: dagger.#Pull & { runtimeImage: core.#Pull & {
source: runtime_image_ref source: runtime_image_ref
} }
depsCache: dagger.#CacheDir & { depsCache: core.#CacheDir & {
id: "depsCache" id: "depsCache"
} }
@ -69,7 +69,7 @@ dagger.#Plan & {
contents: depsCache contents: depsCache
} }
buildCacheTest: dagger.#CacheDir & { buildCacheTest: core.#CacheDir & {
id: "buildCacheTest" id: "buildCacheTest"
} }
@ -78,7 +78,7 @@ dagger.#Plan & {
contents: buildCacheTest contents: buildCacheTest
} }
buildCacheProd: dagger.#CacheDir & { buildCacheProd: core.#CacheDir & {
id: "buildCacheProd" id: "buildCacheProd"
} }
@ -87,7 +87,7 @@ dagger.#Plan & {
contents: buildCacheProd contents: buildCacheProd
} }
nodeModulesCache: dagger.#CacheDir & { nodeModulesCache: core.#CacheDir & {
id: "nodeModulesCache" id: "nodeModulesCache"
} }
@ -96,20 +96,20 @@ dagger.#Plan & {
contents: nodeModulesCache contents: nodeModulesCache
} }
appImage: dagger.#Copy & { appImage: core.#Copy & {
input: runtimeImage.output input: runtimeImage.output
contents: inputs.directories.app.contents contents: inputs.directories.app.contents
dest: "/app" dest: "/app"
} }
deps: dagger.#Exec & { deps: core.#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: dagger.#Exec & { assetsCompile: core.#Exec & {
input: depsCompileProd.output input: depsCompileProd.output
mounts: depsCacheMount & nodeModulesCacheMount mounts: depsCacheMount & nodeModulesCacheMount
workdir: "/app/assets" workdir: "/app/assets"
@ -117,7 +117,7 @@ dagger.#Plan & {
args: ["bash", "-c", "yarn install --frozen-lockfile && yarn run compile"] args: ["bash", "-c", "yarn install --frozen-lockfile && yarn run compile"]
} }
#depsCompile: dagger.#Exec & { #depsCompile: core.#Exec & {
input: deps.output input: deps.output
mounts: depsCacheMount mounts: depsCacheMount
workdir: "/app" workdir: "/app"
@ -134,7 +134,7 @@ dagger.#Plan & {
mounts: buildCacheProdMount mounts: buildCacheProdMount
} }
assetsDigest: dagger.#Exec & { assetsDigest: core.#Exec & {
input: assetsCompile.output input: assetsCompile.output
mounts: depsCacheMount & buildCacheProdMount & nodeModulesCacheMount mounts: depsCacheMount & buildCacheProdMount & nodeModulesCacheMount
env: MIX_ENV: "prod" env: MIX_ENV: "prod"
@ -142,20 +142,20 @@ dagger.#Plan & {
args: ["bash", "-c", "mix phx.digest"] args: ["bash", "-c", "mix phx.digest"]
} }
imageProdCacheCopy: dagger.#Exec & { imageProdCacheCopy: core.#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: dagger.#Copy & { imageProdDockerCopy: core.#Copy & {
input: imageProdCacheCopy.output input: imageProdCacheCopy.output
source: root: inputs.directories.docker.contents source: root: inputs.directories.docker.contents
dest: "/" dest: "/"
} }
imageProd: dagger.#Build & { imageProd: core.#Dockerfile & {
source: imageProdDockerCopy.output source: imageProdDockerCopy.output
dockerfile: path: "/docker/Dockerfile.production" dockerfile: path: "/docker/Dockerfile.production"
buildArg: { buildArg: {

View File

@ -19,7 +19,7 @@ actions: {
// workdir: _ // workdir: _
// // FIXME: remove copy-pasta // // FIXME: remove copy-pasta
// mounts: nodeModules: { // mounts: nodeModules: {
// contents: dagger.#CacheDir & { // contents: core.#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: dagger.#CacheDir & { // contents: core.#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?

View File

@ -67,7 +67,7 @@ import (
} }
if cache.deps != null { if cache.deps != null {
mounts: deps: { mounts: deps: {
contents: dagger.#CacheDir & { contents: core.#CacheDir & {
id: "\(app.name)_deps" id: "\(app.name)_deps"
concurrency: cache.deps concurrency: cache.deps
} }
@ -76,7 +76,7 @@ import (
} }
if cache.build != null { if cache.build != null {
mounts: buildCache: { mounts: buildCache: {
contents: dagger.#CacheDir & { contents: core.#CacheDir & {
id: "\(app.name)_build_\(env)" id: "\(app.name)_build_\(env)"
concurrency: cache.build concurrency: cache.build
} }

View File

@ -2,6 +2,7 @@ package todoapp
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/alpine" "universe.dagger.io/alpine"
"universe.dagger.io/bash" "universe.dagger.io/bash"
"universe.dagger.io/docker" "universe.dagger.io/docker"
@ -9,7 +10,7 @@ import (
) )
dagger.#Plan & { dagger.#Plan & {
_nodeModulesMount: "/src/node_modules": dagger.#Mount & { _nodeModulesMount: "/src/node_modules": {
dest: "/src/node_modules" dest: "/src/node_modules"
type: "cache" type: "cache"
contents: dagger.#CacheDir & { contents: dagger.#CacheDir & {
@ -53,7 +54,7 @@ dagger.#Plan & {
bash.#Run & { bash.#Run & {
workdir: "/src" workdir: "/src"
mounts: { mounts: {
"/cache/yarn": dagger.#Mount & { "/cache/yarn": {
dest: "/cache/yarn" dest: "/cache/yarn"
type: "cache" type: "cache"
contents: dagger.#CacheDir & { contents: dagger.#CacheDir & {
@ -89,7 +90,7 @@ dagger.#Plan & {
"""# """#
} }
contents: dagger.#Subdir & { contents: core.#Subdir & {
input: run.output.rootfs input: run.output.rootfs
path: "/src/build" path: "/src/build"
} }

View File

@ -1,7 +1,8 @@
package git package git
import ( import (
"dagger.io/dagger/core"
) )
#Pull: dagger.#GitPull #Pull: core.#GitPull
#Push: dagger.#GitPush #Push: core.#GitPush

View File

@ -2,6 +2,7 @@ package go
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/go" "universe.dagger.io/go"
"universe.dagger.io/docker" "universe.dagger.io/docker"
"universe.dagger.io/alpine" "universe.dagger.io/alpine"
@ -32,7 +33,7 @@ dagger.#Plan & {
} }
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: exec.output.rootfs input: exec.output.rootfs
path: "/output.txt" path: "/output.txt"
} & { } & {

View File

@ -4,6 +4,7 @@ package netlify
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/alpine" "universe.dagger.io/alpine"
"universe.dagger.io/docker" "universe.dagger.io/docker"
@ -60,7 +61,7 @@ import (
container: bash.#Run & { container: bash.#Run & {
input: *_build.output | docker.#Image input: *_build.output | docker.#Image
script: { script: {
_load: dagger.#Source & { _load: core.#Source & {
path: "." path: "."
include: ["*.sh"] include: ["*.sh"]
} }

View File

@ -2,6 +2,7 @@ package netlify
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
"universe.dagger.io/netlify" "universe.dagger.io/netlify"
@ -20,7 +21,7 @@ dagger.#Plan & {
// Configuration common to all tests // Configuration common to all tests
common: { common: {
testSecrets: dagger.#DecodeSecret & { testSecrets: core.#DecodeSecret & {
input: client.commands.sops.stdout input: client.commands.sops.stdout
format: "yaml" format: "yaml"
} }
@ -29,7 +30,7 @@ dagger.#Plan & {
marker: "hello world" marker: "hello world"
data: dagger.#WriteFile & { data: core.#WriteFile & {
input: dagger.#Scratch input: dagger.#Scratch
path: "index.html" path: "index.html"
contents: marker contents: marker

View File

@ -3,6 +3,7 @@ package powershell
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
) )
@ -26,7 +27,7 @@ import (
contents: string contents: string
_filename: "run.ps1" _filename: "run.ps1"
_write: dagger.#WriteFile & { _write: core.#WriteFile & {
input: dagger.#Scratch input: dagger.#Scratch
path: _filename path: _filename
"contents": contents "contents": contents

View File

@ -2,6 +2,7 @@ package powershell
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
"universe.dagger.io/powershell" "universe.dagger.io/powershell"
@ -19,7 +20,7 @@ dagger.#Plan & {
runFile: { runFile: {
dir: _load.output dir: _load.output
_load: dagger.#Source & { _load: core.#Source & {
path: "./data" path: "./data"
include: ["*.ps1"] include: ["*.ps1"]
} }

View File

@ -2,6 +2,7 @@ package yarn
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker" "universe.dagger.io/docker"
"universe.dagger.io/yarn" "universe.dagger.io/yarn"
@ -78,7 +79,7 @@ dagger.#Plan & {
path: string path: string
contents: string contents: string
_read: dagger.#ReadFile & { _read: core.#ReadFile & {
"input": input "input": input
"path": path "path": path
} }

View File

@ -5,6 +5,7 @@ import (
"strings" "strings"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/alpine" "universe.dagger.io/alpine"
"universe.dagger.io/bash" "universe.dagger.io/bash"
@ -78,7 +79,7 @@ import (
mounts: "yarn cache": { mounts: "yarn cache": {
dest: "/cache/yarn" dest: "/cache/yarn"
contents: dagger.#CacheDir & { contents: core.#CacheDir & {
// FIXME: are there character limitations in cache ID? // FIXME: are there character limitations in cache ID?
id: "universe.dagger.io/yarn.#Run \(name)" id: "universe.dagger.io/yarn.#Run \(name)"
} }
@ -109,7 +110,7 @@ import (
mounts: "yarn cache": { mounts: "yarn cache": {
dest: "/cache/yarn" dest: "/cache/yarn"
contents: dagger.#CacheDir & { contents: core.#CacheDir & {
// FIXME: are there character limitations in cache ID? // FIXME: are there character limitations in cache ID?
id: "universe.dagger.io/yarn.#Run \(name)" id: "universe.dagger.io/yarn.#Run \(name)"
} }
@ -135,7 +136,7 @@ import (
} }
// The final contents of the package after run // The final contents of the package after run
_output: dagger.#Subdir & { _output: core.#Subdir & {
input: _run.output.rootfs input: _run.output.rootfs
path: "/build" path: "/build"
} }

View File

@ -1,10 +1,10 @@
package main package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger/core"
) )
_source: dagger.#Source & { _source: core.#Source & {
path: "." path: "."
exclude: [ exclude: [
"ci", "ci",

View File

@ -36,6 +36,7 @@ setup() {
assert_output --partial 'client.filesystem."./test_do".write' assert_output --partial 'client.filesystem."./test_do".write'
refute_output --partial "actions.notMe" refute_output --partial "actions.notMe"
refute_output --partial 'client.filesystem."./dependent_do".write' refute_output --partial 'client.filesystem."./dependent_do".write'
rm -f ./test_do
} }
@test "plan/do: nice error message for 0.1.0 projects" { @test "plan/do: nice error message for 0.1.0 projects" {

View File

@ -3,6 +3,7 @@ package main
import ( import (
"strings" "strings"
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -28,28 +29,28 @@ dagger.#Plan & {
invalid: name: "foobar" invalid: name: "foobar"
} }
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: { test: {
invalid: dagger.#Exec & { invalid: core.#Exec & {
input: image.output input: image.output
args: ["echo", client.commands.invalid.stdout] args: ["echo", client.commands.invalid.stdout]
} }
valid: { valid: {
normal: dagger.#Exec & { normal: core.#Exec & {
input: image.output input: image.output
args: ["test", strings.TrimSpace(client.commands.normal.stdout), "=", "hello europa"] args: ["test", strings.TrimSpace(client.commands.normal.stdout), "=", "hello europa"]
} }
relative: dagger.#Exec & { relative: core.#Exec & {
input: image.output input: image.output
args: ["test", strings.TrimSpace(client.commands.relative.stdout), "=", "test"] args: ["test", strings.TrimSpace(client.commands.relative.stdout), "=", "test"]
} }
error: dagger.#Exec & { error: core.#Exec & {
input: image.output input: image.output
args: ["test", strings.TrimSpace(client.commands.error.stderr), "=", "error"] args: ["test", strings.TrimSpace(client.commands.error.stderr), "=", "error"]
} }
secret: dagger.#Exec & { secret: core.#Exec & {
input: image.output input: image.output
mounts: secret: { mounts: secret: {
dest: "/run/secrets/test" dest: "/run/secrets/test"

View File

@ -2,16 +2,17 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: env: TEST_FAIL: "env" client: env: TEST_FAIL: "env"
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: dagger.#Exec & { test: core.#Exec & {
input: image.output input: image.output
args: [client.env.TEST_FAIL] args: [client.env.TEST_FAIL]
} }

View File

@ -2,6 +2,7 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -10,15 +11,15 @@ dagger.#Plan & {
TEST_SECRET: dagger.#Secret TEST_SECRET: dagger.#Secret
} }
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: { test: {
string: dagger.#Exec & { string: core.#Exec & {
input: image.output input: image.output
args: ["test", client.env.TEST_STRING, "=", "foo"] args: ["test", client.env.TEST_STRING, "=", "foo"]
} }
secret: dagger.#Exec & { secret: core.#Exec & {
input: image.output input: image.output
mounts: secret: { mounts: secret: {
dest: "/run/secrets/test" dest: "/run/secrets/test"

View File

@ -2,6 +2,7 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -11,15 +12,15 @@ dagger.#Plan & {
write: contents: actions.test.export.contents write: contents: actions.test.export.contents
} }
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: { test: {
read: dagger.#Exec & { read: core.#Exec & {
input: image.output input: image.output
args: ["echo", client.filesystem."test.txt".read.contents] args: ["echo", client.filesystem."test.txt".read.contents]
} }
write: dagger.#Exec & { write: core.#Exec & {
input: image.output input: image.output
args: ["sh", "-c", args: ["sh", "-c",
#""" #"""
@ -27,7 +28,7 @@ dagger.#Plan & {
"""#, """#,
] ]
} }
export: dagger.#ReadFile & { export: core.#ReadFile & {
input: write.output input: write.output
path: "out.txt" path: "out.txt"
} }

View File

@ -2,6 +2,7 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -11,20 +12,20 @@ dagger.#Plan & {
"secret.txt": read: contents: dagger.#Secret "secret.txt": read: contents: dagger.#Secret
} }
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: { test: {
concrete: dagger.#Exec & { concrete: core.#Exec & {
input: image.output input: image.output
args: ["sh", "-c", client.filesystem."cmd.sh".read.contents] args: ["sh", "-c", client.filesystem."cmd.sh".read.contents]
} }
usage: { usage: {
string: dagger.#Exec & { string: core.#Exec & {
input: image.output input: image.output
args: ["test", client.filesystem."test.txt".read.contents, "=", "foo"] args: ["test", client.filesystem."test.txt".read.contents, "=", "foo"]
} }
secret: dagger.#Exec & { secret: core.#Exec & {
input: image.output input: image.output
mounts: secret: { mounts: secret: {
dest: "/run/secrets/test" dest: "/run/secrets/test"

View File

@ -2,6 +2,7 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -10,7 +11,7 @@ dagger.#Plan & {
include: ["*.txt"] include: ["*.txt"]
} }
actions: test: { actions: test: {
[string]: dagger.#ReadFile & { [string]: core.#ReadFile & {
input: client.filesystem."../rootfs".read.contents input: client.filesystem."../rootfs".read.contents
} }
valid: { valid: {

View File

@ -2,6 +2,7 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -10,7 +11,7 @@ dagger.#Plan & {
exclude: ["*.log"] exclude: ["*.log"]
} }
actions: test: { actions: test: {
[string]: dagger.#ReadFile & { [string]: core.#ReadFile & {
input: client.filesystem.rootfs.read.contents input: client.filesystem.rootfs.read.contents
} }
valid: { valid: {

View File

@ -2,22 +2,23 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.soc": read: contents: dagger.#Service client: filesystem: "/var/run/docker.soc": read: contents: dagger.#Service
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
imageWithDocker: dagger.#Exec & { imageWithDocker: core.#Exec & {
input: image.output input: image.output
args: ["apk", "add", "--no-cache", "docker-cli"] args: ["apk", "add", "--no-cache", "docker-cli"]
} }
test: dagger.#Exec & { test: core.#Exec & {
input: imageWithDocker.output input: imageWithDocker.output
mounts: docker: { mounts: docker: {
dest: "/var/run/docker.sock" dest: "/var/run/docker.sock"

View File

@ -2,22 +2,23 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
imageWithDocker: dagger.#Exec & { imageWithDocker: core.#Exec & {
input: image.output input: image.output
args: ["apk", "add", "--no-cache", "docker-cli"] args: ["apk", "add", "--no-cache", "docker-cli"]
} }
test: dagger.#Exec & { test: core.#Exec & {
input: imageWithDocker.output input: imageWithDocker.output
mounts: docker: { mounts: docker: {
dest: "/var/run/docker.sock" dest: "/var/run/docker.sock"

View File

@ -2,22 +2,23 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "//./pipe/docker_engine": read: contents: dagger.#Service client: filesystem: "//./pipe/docker_engine": read: contents: dagger.#Service
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
imageWithDocker: dagger.#Exec & { imageWithDocker: core.#Exec & {
input: image.output input: image.output
args: ["apk", "add", "--no-cache", "docker-cli"] args: ["apk", "add", "--no-cache", "docker-cli"]
} }
test: dagger.#Exec & { test: core.#Exec & {
input: imageWithDocker.output input: imageWithDocker.output
mounts: docker: { mounts: docker: {
dest: "/var/run/docker.sock" dest: "/var/run/docker.sock"

View File

@ -2,6 +2,7 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -15,30 +16,30 @@ dagger.#Plan & {
} }
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: { test: {
fs: data: dagger.#WriteFile & { fs: data: core.#WriteFile & {
input: dagger.#Scratch input: dagger.#Scratch
path: "/test" path: "/test"
contents: "foobar" contents: "foobar"
} }
file: { file: {
// Only using contents for reference in client // Only using contents for reference in client
data: dagger.#WriteFile & { data: core.#WriteFile & {
input: dagger.#Scratch input: dagger.#Scratch
path: "/test" path: "/test"
contents: "foobaz" contents: "foobaz"
} }
} }
secret: { secret: {
create: dagger.#WriteFile & { create: core.#WriteFile & {
input: dagger.#Scratch input: dagger.#Scratch
path: "/test" path: "/test"
contents: "foo-barab-oof" contents: "foo-barab-oof"
} }
data: dagger.#NewSecret & { data: core.#NewSecret & {
input: create.output input: create.output
path: "/test" path: "/test"
} }

View File

@ -2,21 +2,21 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
// "alpha.dagger.io/os" "dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: test: { actions: test: {
_image: dagger.#Pull & { _image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
_exec: dagger.#Exec & { _exec: core.#Exec & {
input: _image.output input: _image.output
args: ["sh", "-c", "echo -n Hello Europa > /out.txt"] args: ["sh", "-c", "echo -n Hello Europa > /out.txt"]
} }
_verify: dagger.#ReadFile & { _verify: core.#ReadFile & {
input: _exec.output input: _exec.output
path: "/out.txt" path: "/out.txt"
} & { } & {

View File

@ -1,17 +1,19 @@
package main package main
import ( import (
"dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
platform: "linux/unknown" platform: "linux/unknown"
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0" source: "alpine:3.15.0"
} }
writeArch: dagger.#Exec & { writeArch: core.#Exec & {
input: image.output input: image.output
always: true always: true
args: [ args: [
@ -21,7 +23,7 @@ dagger.#Plan & {
] ]
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: writeArch.output input: writeArch.output
path: "/arch.txt" path: "/arch.txt"
} & { } & {

View File

@ -1,17 +1,19 @@
package main package main
import ( import (
"dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
platform: "linux/amd64" platform: "linux/amd64"
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0" source: "alpine:3.15.0"
} }
writeArch: dagger.#Exec & { writeArch: core.#Exec & {
input: image.output input: image.output
always: true always: true
args: [ args: [
@ -21,7 +23,7 @@ dagger.#Plan & {
] ]
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: writeArch.output input: writeArch.output
path: "/arch.txt" path: "/arch.txt"
} & { } & {

View File

@ -1,17 +1,19 @@
package main package main
import ( import (
"dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
platform: "linux/arm64" platform: "linux/arm64"
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0" source: "alpine:3.15.0"
} }
writeArch: dagger.#Exec & { writeArch: core.#Exec & {
input: image.output input: image.output
always: true always: true
args: [ args: [
@ -21,7 +23,7 @@ dagger.#Plan & {
] ]
} }
verify: dagger.#ReadFile & { verify: core.#ReadFile & {
input: writeArch.output input: writeArch.output
path: "/arch.txt" path: "/arch.txt"
} & { } & {

View File

@ -2,18 +2,19 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
params: foo: string params: foo: string
_image: dagger.#Pull & { _image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: { test: {
[string]: dagger.#Exec & { [string]: core.#Exec & {
input: _image.output input: _image.output
env: FOO: string env: FOO: string
args: [ args: [

View File

@ -63,7 +63,7 @@ setup() {
@test "task: #Dockerfile" { @test "task: #Dockerfile" {
cd "$TESTDIR"/tasks/dockerfile cd "$TESTDIR"/tasks/dockerfile
"$DAGGER" "do" -p ./dockerfile.cue "$DAGGER" "do" -p ./dockerfile.cue verify
"$DAGGER" "do" -p ./inlined_dockerfile.cue verify "$DAGGER" "do" -p ./inlined_dockerfile.cue verify
"$DAGGER" "do" -p ./inlined_dockerfile_heredoc.cue verify "$DAGGER" "do" -p ./inlined_dockerfile_heredoc.cue verify
"$DAGGER" "do" -p ./dockerfile_path.cue verify "$DAGGER" "do" -p ./dockerfile_path.cue verify

View File

@ -2,15 +2,16 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
exec: dagger.#Exec & { exec: core.#Exec & {
input: image.output input: image.output
args: [ args: [
"sh", "-c", "sh", "-c",
@ -20,7 +21,7 @@ dagger.#Plan & {
] ]
} }
test: { test: {
verify_file: dagger.#ReadFile & { verify_file: core.#ReadFile & {
input: exec.output input: exec.output
path: "/output.txt" path: "/output.txt"
} & { } & {
@ -28,14 +29,14 @@ dagger.#Plan & {
contents: "hello world" contents: "hello world"
} }
copy: dagger.#Copy & { copy: core.#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: dagger.#ReadFile & { verify_copy: core.#ReadFile & {
input: copy.output input: copy.output
path: "/output.txt" path: "/output.txt"
} & { } & {

View File

@ -2,15 +2,16 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
exec: dagger.#Exec & { exec: core.#Exec & {
input: image.output input: image.output
args: [ args: [
"sh", "-c", "sh", "-c",
@ -21,7 +22,7 @@ dagger.#Plan & {
} }
test: { test: {
verify_file: dagger.#ReadFile & { verify_file: core.#ReadFile & {
input: exec.output input: exec.output
path: "/output.txt" path: "/output.txt"
} & { } & {
@ -29,13 +30,13 @@ dagger.#Plan & {
contents: "hello world from dagger" contents: "hello world from dagger"
} }
copy: dagger.#Copy & { copy: core.#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: dagger.#ReadFile & { verify_copy: core.#ReadFile & {
input: copy.output input: copy.output
path: "/output.txt" path: "/output.txt"
} & { } & {

View File

@ -2,20 +2,21 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
alpine3_15_0: dagger.#Pull & { alpine3_15_0: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
busybox1_34_1: dagger.#Pull & { busybox1_34_1: core.#Pull & {
source: "busybox:1.34.1-glibc@sha256:ec98391b8f0911db08be2ee6c46813eeac17b9625b402ea1ce45dcfcd05d78d6" source: "busybox:1.34.1-glibc@sha256:ec98391b8f0911db08be2ee6c46813eeac17b9625b402ea1ce45dcfcd05d78d6"
} }
test: { test: {
verify_alpine_3_15_0: dagger.#ReadFile & { verify_alpine_3_15_0: core.#ReadFile & {
input: alpine3_15_0.output input: alpine3_15_0.output
path: "/etc/alpine-release" path: "/etc/alpine-release"
} & { } & {
@ -23,14 +24,14 @@ dagger.#Plan & {
contents: "3.15.0\n" contents: "3.15.0\n"
} }
copy: dagger.#Copy & { copy: core.#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: dagger.#ReadFile & { verify_copy: core.#ReadFile & {
input: copy.output input: copy.output
path: "/alpine3_15_0_release" path: "/alpine3_15_0_release"
} & { } & {

View File

@ -2,18 +2,19 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
alpineBase: dagger.#Pull & { alpineBase: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
busyboxBase: dagger.#Pull & { busyboxBase: core.#Pull & {
source: "busybox:1.34.1@sha256:1286c6d3c393023ef93c247724a6a2d665528144ffe07bacb741cc2b4edfefad" source: "busybox:1.34.1@sha256:1286c6d3c393023ef93c247724a6a2d665528144ffe07bacb741cc2b4edfefad"
} }
exec1: dagger.#Exec & { exec1: core.#Exec & {
input: alpineBase.output input: alpineBase.output
args: [ args: [
"sh", "-c", "sh", "-c",
@ -23,7 +24,7 @@ dagger.#Plan & {
] ]
} }
exec2: dagger.#Exec & { exec2: core.#Exec & {
input: exec1.output input: exec1.output
args: [ args: [
"sh", "-c", "sh", "-c",
@ -33,46 +34,46 @@ dagger.#Plan & {
] ]
} }
removeme: dagger.#WriteFile & { removeme: core.#WriteFile & {
input: dagger.#Scratch input: dagger.#Scratch
path: "/removeme" path: "/removeme"
contents: "removeme" contents: "removeme"
} }
test: { test: {
diff: dagger.#Diff & { diff: core.#Diff & {
lower: alpineBase.output lower: alpineBase.output
upper: exec2.output upper: exec2.output
} }
verify_diff_foo: dagger.#ReadFile & { verify_diff_foo: core.#ReadFile & {
input: diff.output input: diff.output
path: "/dir/foo" path: "/dir/foo"
} & { } & {
contents: "foo" contents: "foo"
} }
verify_diff_bar: dagger.#ReadFile & { verify_diff_bar: core.#ReadFile & {
input: diff.output input: diff.output
path: "/dir/bar" path: "/dir/bar"
} & { } & {
contents: "bar" contents: "bar"
} }
mergediff: dagger.#Merge & { mergediff: core.#Merge & {
inputs: [ inputs: [
busyboxBase.output, busyboxBase.output,
removeme.output, removeme.output,
diff.output, diff.output,
] ]
} }
verify_remove: dagger.#Exec & { verify_remove: core.#Exec & {
input: mergediff.output input: mergediff.output
args: ["test", "!", "-e", "/removeme"] args: ["test", "!", "-e", "/removeme"]
} }
verify_no_alpine_base: dagger.#Exec & { verify_no_alpine_base: core.#Exec & {
input: mergediff.output input: mergediff.output
// make sure the the Diff actually separated files from the base // make sure the the Diff actually separated files from the base
// by testing the non-existence of a file that only exists in the // by testing the non-existence of a file that only exists in the
// alpine base, not busybox // alpine base, not busybox
args: ["test", "!", "-e", "/etc/alpine-release"] args: ["test", "!", "-e", "/etc/alpine-release"]
} }

View File

@ -2,12 +2,13 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: testdata: read: contents: dagger.#FS client: filesystem: testdata: read: contents: dagger.#FS
actions: build: dagger.#Dockerfile & { actions: build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
dockerfile: contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d

View File

@ -2,6 +2,7 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -15,12 +16,12 @@ dagger.#Plan & {
} }
actions: { actions: {
sopsSecrets: dagger.#DecodeSecret & { sopsSecrets: core.#DecodeSecret & {
format: "yaml" format: "yaml"
input: client.commands.sops.stdout input: client.commands.sops.stdout
} }
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
auth: "daggerio/ci-test:private-pull": { auth: "daggerio/ci-test:private-pull": {
username: "daggertest" username: "daggertest"

View File

@ -2,17 +2,18 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: testdata: read: contents: dagger.#FS client: filesystem: testdata: read: contents: dagger.#FS
actions: { actions: {
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: build.output input: build.output
args: ["sh", "-c", "test $(cat /dir/foo) = foobar"] args: ["sh", "-c", "test $(cat /dir/foo) = foobar"]
} }

View File

@ -2,18 +2,19 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: testdata: read: contents: dagger.#FS client: filesystem: testdata: read: contents: dagger.#FS
actions: { actions: {
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
dockerfile: path: "./dockerfilepath/Dockerfile.custom" dockerfile: path: "./dockerfilepath/Dockerfile.custom"
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: build.output input: build.output
args: ["sh", "-c", "test $(cat /test) = dockerfilePath"] args: ["sh", "-c", "test $(cat /test) = dockerfilePath"]
} }

View File

@ -2,6 +2,7 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -9,7 +10,7 @@ dagger.#Plan & {
actions: { actions: {
// FIXME: this doesn't test anything beside not crashing // FIXME: this doesn't test anything beside not crashing
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
dockerfile: contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d

View File

@ -2,13 +2,14 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: testdata: read: contents: dagger.#FS client: filesystem: testdata: read: contents: dagger.#FS
actions: { actions: {
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
dockerfile: contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
@ -16,7 +17,7 @@ dagger.#Plan & {
""" """
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: build.output input: build.output
args: ["sh", "-c", "test $(cat /output) = foobar"] args: ["sh", "-c", "test $(cat /output) = foobar"]
} }

View File

@ -2,13 +2,14 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: testdata: read: contents: dagger.#FS client: filesystem: testdata: read: contents: dagger.#FS
actions: { actions: {
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
dockerfile: contents: """ dockerfile: contents: """
# syntax = docker/dockerfile:1.3 # syntax = docker/dockerfile:1.3
@ -17,7 +18,7 @@ dagger.#Plan & {
""" """
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: build.output input: build.output
args: ["sh", "-c", "test $(cat /output) = foobar"] args: ["sh", "-c", "test $(cat /output) = foobar"]
} }

View File

@ -2,6 +2,7 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -9,7 +10,7 @@ dagger.#Plan & {
actions: { actions: {
// FIXME: this doesn't test anything beside not crashing // FIXME: this doesn't test anything beside not crashing
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
dockerfile: contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d

View File

@ -2,6 +2,7 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -9,7 +10,7 @@ dagger.#Plan & {
actions: { actions: {
// FIXME: this doesn't test anything beside not crashing // FIXME: this doesn't test anything beside not crashing
build: dagger.#Dockerfile & { build: core.#Dockerfile & {
source: client.filesystem.testdata.read.contents source: client.filesystem.testdata.read.contents
dockerfile: contents: """ dockerfile: contents: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d

View File

@ -2,20 +2,21 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
exec: dagger.#Exec & { exec: core.#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: dagger.#ReadFile & { verify: core.#ReadFile & {
input: exec.output input: exec.output
path: "/output.txt" path: "/output.txt"
} & { } & {

View File

@ -2,15 +2,16 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
env: TEST: "hello world" env: TEST: "hello world"
args: [ args: [

View File

@ -2,17 +2,18 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "secret.txt": read: contents: dagger.#Secret client: filesystem: "secret.txt": read: contents: dagger.#Secret
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
env: TEST: client.filesystem."secret.txt".read.contents env: TEST: client.filesystem."secret.txt".read.contents
args: [ args: [

View File

@ -2,15 +2,16 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
hosts: "unit.test": "1.2.3.4" hosts: "unit.test": "1.2.3.4"
args: [ args: [

View File

@ -2,19 +2,20 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
sharedCache: dagger.#CacheDir & { sharedCache: core.#CacheDir & {
id: "mycache" id: "mycache"
} }
exec: dagger.#Exec & { exec: core.#Exec & {
input: image.output input: image.output
mounts: cache: { mounts: cache: {
dest: "/cache" dest: "/cache"
@ -29,7 +30,7 @@ dagger.#Plan & {
} }
test: { test: {
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
mounts: cache: { mounts: cache: {
dest: "/cache" dest: "/cache"
@ -44,10 +45,10 @@ dagger.#Plan & {
] ]
} }
otherCache: dagger.#CacheDir & { otherCache: core.#CacheDir & {
id: "othercache" id: "othercache"
} }
verifyOtherCache: dagger.#Exec & { verifyOtherCache: core.#Exec & {
input: image.output input: image.output
mounts: cache: { mounts: cache: {
dest: "/cache" dest: "/cache"

View File

@ -2,15 +2,16 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
exec: dagger.#Exec & { exec: core.#Exec & {
input: image.output input: image.output
args: [ args: [
"sh", "-c", "sh", "-c",
@ -21,7 +22,7 @@ dagger.#Plan & {
} }
test: { test: {
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
mounts: fs: { mounts: fs: {
dest: "/target" dest: "/target"
@ -36,7 +37,7 @@ dagger.#Plan & {
] ]
} }
verifyRO: dagger.#Exec & { verifyRO: core.#Exec & {
input: image.output input: image.output
mounts: fs: { mounts: fs: {
dest: "/target" dest: "/target"
@ -54,7 +55,7 @@ dagger.#Plan & {
] ]
} }
verifySource: dagger.#Exec & { verifySource: core.#Exec & {
input: image.output input: image.output
mounts: fs: { mounts: fs: {
dest: "/target.txt" dest: "/target.txt"

View File

@ -2,17 +2,18 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: env: TESTSECRET: dagger.#Secret client: env: TESTSECRET: dagger.#Secret
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
test: { test: {
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
mounts: secret: { mounts: secret: {
dest: "/run/secrets/test" dest: "/run/secrets/test"
@ -27,7 +28,7 @@ dagger.#Plan & {
] ]
} }
verifyPerm: dagger.#Exec & { verifyPerm: core.#Exec & {
input: image.output input: image.output
mounts: secret: { mounts: secret: {
dest: "/run/secrets/test" dest: "/run/secrets/test"

View File

@ -2,22 +2,23 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
imageWithDocker: dagger.#Exec & { imageWithDocker: core.#Exec & {
input: image.output input: image.output
args: ["apk", "add", "--no-cache", "docker-cli"] args: ["apk", "add", "--no-cache", "docker-cli"]
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: imageWithDocker.output input: imageWithDocker.output
mounts: docker: { mounts: docker: {
dest: "/var/run/docker.sock" dest: "/var/run/docker.sock"

View File

@ -2,19 +2,20 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
exec: dagger.#Exec & { exec: core.#Exec & {
input: image.output input: image.output
mounts: temp: { mounts: temp: {
dest: "/temp" dest: "/temp"
contents: dagger.#TempDir contents: core.#TempDir
} }
args: [ args: [
"sh", "-c", "sh", "-c",
@ -24,7 +25,7 @@ dagger.#Plan & {
] ]
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: exec.output input: exec.output
args: [ args: [
"sh", "-c", "sh", "-c",

View File

@ -2,20 +2,21 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
addUser: dagger.#Exec & { addUser: core.#Exec & {
input: image.output input: image.output
args: ["adduser", "-D", "test"] args: ["adduser", "-D", "test"]
} }
test: { test: {
verifyUsername: dagger.#Exec & { verifyUsername: core.#Exec & {
input: addUser.output input: addUser.output
user: "test" user: "test"
args: [ args: [
@ -26,7 +27,7 @@ dagger.#Plan & {
] ]
} }
verifyUserID: dagger.#Exec & { verifyUserID: core.#Exec & {
input: addUser.output input: addUser.output
user: "1000" user: "1000"
args: [ args: [

View File

@ -2,15 +2,16 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
workdir: "/tmp" workdir: "/tmp"
args: [ args: [

View File

@ -2,21 +2,22 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: test: { actions: test: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15" source: "alpine:3.15"
} }
export: dagger.#Export & { export: core.#Export & {
input: image.output input: image.output
config: image.config config: image.config
tag: "example" tag: "example"
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
mounts: exported: { mounts: exported: {
contents: export.output contents: export.output

View File

@ -2,10 +2,11 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: badref: dagger.#GitPull & { actions: badref: core.#GitPull & {
remote: "https://github.com/blocklayerhq/acme-clothing.git" remote: "https://github.com/blocklayerhq/acme-clothing.git"
ref: "lalalalal" ref: "lalalalal"
} }

View File

@ -2,10 +2,11 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: badremote: dagger.#GitPull & { actions: badremote: core.#GitPull & {
remote: "https://github.com/blocklayerhq/lalalala.git" remote: "https://github.com/blocklayerhq/lalalala.git"
ref: "master" ref: "master"
} }

View File

@ -2,10 +2,11 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: gitPull: dagger.#GitPull & { actions: gitPull: core.#GitPull & {
remote: "https://github.com/blocklayerhq/acme-clothing.git" remote: "https://github.com/blocklayerhq/acme-clothing.git"
ref: "master" ref: "master"
} }

View File

@ -2,26 +2,27 @@ package testing
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
repo1: dagger.#GitPull & { repo1: core.#GitPull & {
remote: "https://github.com/blocklayerhq/acme-clothing.git" remote: "https://github.com/blocklayerhq/acme-clothing.git"
ref: "master" ref: "master"
} }
repo2: dagger.#GitPull & { repo2: core.#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: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0" source: "alpine:3.15.0"
} }
verify: dagger.#Exec & { verify: core.#Exec & {
input: image.output input: image.output
args: ["sh", "-c", """ args: ["sh", "-c", """
set -eu set -eu

View File

@ -2,8 +2,9 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: invalid: dagger.#GitPull & {} actions: invalid: core.#GitPull & {}
} }

View File

@ -2,6 +2,7 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
@ -13,16 +14,16 @@ dagger.#Plan & {
actions: { actions: {
alpine: dagger.#Pull & { alpine: core.#Pull & {
source: "alpine:3.15.0" source: "alpine:3.15.0"
} }
sopsSecrets: dagger.#DecodeSecret & { sopsSecrets: core.#DecodeSecret & {
format: "yaml" format: "yaml"
input: client.commands.sops.stdout input: client.commands.sops.stdout
} }
testRepo: dagger.#GitPull & { testRepo: core.#GitPull & {
remote: "https://github.com/dagger/dagger.git" remote: "https://github.com/dagger/dagger.git"
ref: "main" ref: "main"
auth: { auth: {
@ -31,7 +32,7 @@ dagger.#Plan & {
} }
} }
testContent: dagger.#Exec & { testContent: core.#Exec & {
input: alpine.output input: alpine.output
always: true always: true
args: ["ls", "-l", "/repo/README.md"] args: ["ls", "-l", "/repo/README.md"]

View File

@ -2,21 +2,22 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
"testing.dagger.io/hidden" "testing.dagger.io/hidden"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
pull: dagger.#Pull & { pull: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
_write: dagger.#WriteFile & { _write: core.#WriteFile & {
input: pull.output input: pull.output
path: "/testing" path: "/testing"
contents: "1,2,3" contents: "1,2,3"
permissions: 700 permissions: 700
} }
readfile: dagger.#ReadFile & { readfile: core.#ReadFile & {
input: _write.output input: _write.output
path: "/testing" path: "/testing"
} & { } & {

View File

@ -2,10 +2,11 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: fetch: dagger.#HTTPFetch & { actions: fetch: core.#HTTPFetch & {
source: "https://releases.dagger.io/dagger/latest_version" source: "https://releases.dagger.io/dagger/latest_version"
dest: "/latest.html" dest: "/latest.html"
} }

View File

@ -2,10 +2,11 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: fetch: dagger.#HTTPFetch & { actions: fetch: core.#HTTPFetch & {
source: "https://releases.dagger.io/dagger/asfgdsfg" source: "https://releases.dagger.io/dagger/asfgdsfg"
dest: "/latest.html" dest: "/latest.html"
} }

View File

@ -2,15 +2,16 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
exec: dagger.#Exec & { exec: core.#Exec & {
input: image.output input: image.output
args: [ args: [
"sh", "-c", "sh", "-c",
@ -20,31 +21,31 @@ dagger.#Plan & {
] ]
} }
dir: dagger.#Mkdir & { dir: core.#Mkdir & {
input: dagger.#Scratch input: dagger.#Scratch
path: "/dir" path: "/dir"
} }
dirfoo: dagger.#WriteFile & { dirfoo: core.#WriteFile & {
input: dir.output input: dir.output
path: "/dir/foo" path: "/dir/foo"
contents: "foo" contents: "foo"
} }
dirfoo2: dagger.#WriteFile & { dirfoo2: core.#WriteFile & {
input: dir.output input: dir.output
path: "/dir/foo" path: "/dir/foo"
contents: "foo2" contents: "foo2"
} }
dirbar: dagger.#WriteFile & { dirbar: core.#WriteFile & {
input: dir.output input: dir.output
path: "/dir/bar" path: "/dir/bar"
contents: "bar" contents: "bar"
} }
test: { test: {
merge: dagger.#Merge & { merge: core.#Merge & {
inputs: [ inputs: [
dir.output, dir.output,
dirfoo.output, dirfoo.output,
@ -54,19 +55,19 @@ dagger.#Plan & {
] ]
} }
verify_merge_output: dagger.#ReadFile & { verify_merge_output: core.#ReadFile & {
input: merge.output input: merge.output
path: "/output.txt" path: "/output.txt"
} & { } & {
contents: "hello world" contents: "hello world"
} }
verify_merge_dirbar: dagger.#ReadFile & { verify_merge_dirbar: core.#ReadFile & {
input: merge.output input: merge.output
path: "/dir/bar" path: "/dir/bar"
} & { } & {
contents: "bar" contents: "bar"
} }
verify_merge_dirfoo: dagger.#ReadFile & { verify_merge_dirfoo: core.#ReadFile & {
input: merge.output input: merge.output
path: "/dir/foo" path: "/dir/foo"
} & { } & {

View File

@ -2,27 +2,28 @@ package main
import ( import (
"dagger.io/dagger" "dagger.io/dagger"
"dagger.io/dagger/core"
) )
dagger.#Plan & { dagger.#Plan & {
actions: { actions: {
image: dagger.#Pull & { image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
} }
mkdir: dagger.#Mkdir & { mkdir: core.#Mkdir & {
input: image.output input: image.output
path: "/test" path: "/test"
} }
writeChecker: dagger.#WriteFile & { writeChecker: core.#WriteFile & {
input: mkdir.output input: mkdir.output
path: "/test/foo" path: "/test/foo"
contents: "bar" contents: "bar"
permissions: 700 permissions: 700
} }
readChecker: dagger.#ReadFile & { readChecker: core.#ReadFile & {
input: writeChecker.output input: writeChecker.output
path: "/test/foo" path: "/test/foo"
} & { } & {

Some files were not shown because too many files have changed in this diff Show More