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 (
"dagger.io/dagger"
"universe.dagger.io/docker"
)
dagger.#Plan & {
client: filesystem: "./src": read: contents: dagger.#FS
actions: build: dagger.#Dockerfile & {
actions: build: docker.#Dockerfile & {
// This is the context.
source: client.filesystem."./src".read.contents

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
package dagger
package core
// Access the source directory for the current CUE 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
#GitPush: {
@ -11,7 +11,7 @@ package dagger
}
// 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.
#GitPull: {
$dagger: task: _name: "GitPull"

View File

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

View File

@ -1,31 +1,6 @@
package dagger
package core
import (
"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
}
import "list"
// A ref is an address for a remote container image
//
@ -62,6 +37,29 @@ import (
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
#Pull: {
$dagger: task: _name: "Pull"

View File

@ -1,4 +1,4 @@
package dagger
package core
// A core action that does nothing
// 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.
#Plan: {

View File

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

View File

@ -1,4 +1,4 @@
package dagger
package core
// A reference to a filesystem tree.
// 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,
}
DaggerPackage = fmt.Sprintf("%s/dagger", DaggerModule)
DaggerPackage = fmt.Sprintf("%s/dagger/core", DaggerModule)
lockFilePath = "dagger.lock"
)

View File

@ -2,6 +2,7 @@ package alpine
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/alpine"
"universe.dagger.io/docker"
@ -16,7 +17,7 @@ dagger.#Plan & {
version: "3.10.9"
}
verify: dagger.#Readfile & {
verify: core.#ReadFile & {
input: build.output.rootfs
path: "/etc/alpine-release"
contents: "3.10.9\n"

View File

@ -3,13 +3,14 @@ package aws
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
"universe.dagger.io/docker"
)
#DefaultLinuxVersion: "amazonlinux:2.0.20220121.0@sha256:f3a37f84f2644095e2c6f6fdf2bf4dbf68d5436c51afcfbfa747a5de391d5d62"
#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.
// Used by default with aws.#Run
#Build: {
@ -39,7 +40,7 @@ import (
]
}
_scripts: dagger.#Source & {
_scripts: core.#Source & {
path: "_scripts"
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@ actions: {
// workdir: _
// // FIXME: remove copy-pasta
// mounts: nodeModules: {
// contents: dagger.#CacheDir & {
// contents: core.#CacheDir & {
// // FIXME: do we need an ID here?
// id: "\(mix.app)_assets_node_modules"
// // 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?)
// mounts: nodeModules: {
// contents: dagger.#CacheDir & {
// contents: core.#CacheDir & {
// // FIXME: do we need an ID here?
// id: "\(mix.app)_assets_node_modules"
// // FIXME: will there be multiple writers?

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -63,7 +63,7 @@ setup() {
@test "task: #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_heredoc.cue verify
"$DAGGER" "do" -p ./dockerfile_path.cue verify

View File

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

View File

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

View File

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

View File

@ -2,18 +2,19 @@ package main
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
)
dagger.#Plan & {
actions: {
alpineBase: dagger.#Pull & {
alpineBase: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
}
busyboxBase: dagger.#Pull & {
busyboxBase: core.#Pull & {
source: "busybox:1.34.1@sha256:1286c6d3c393023ef93c247724a6a2d665528144ffe07bacb741cc2b4edfefad"
}
exec1: dagger.#Exec & {
exec1: core.#Exec & {
input: alpineBase.output
args: [
"sh", "-c",
@ -23,7 +24,7 @@ dagger.#Plan & {
]
}
exec2: dagger.#Exec & {
exec2: core.#Exec & {
input: exec1.output
args: [
"sh", "-c",
@ -33,46 +34,46 @@ dagger.#Plan & {
]
}
removeme: dagger.#WriteFile & {
removeme: core.#WriteFile & {
input: dagger.#Scratch
path: "/removeme"
contents: "removeme"
}
test: {
diff: dagger.#Diff & {
diff: core.#Diff & {
lower: alpineBase.output
upper: exec2.output
}
verify_diff_foo: dagger.#ReadFile & {
verify_diff_foo: core.#ReadFile & {
input: diff.output
path: "/dir/foo"
} & {
contents: "foo"
}
verify_diff_bar: dagger.#ReadFile & {
verify_diff_bar: core.#ReadFile & {
input: diff.output
path: "/dir/bar"
} & {
contents: "bar"
}
mergediff: dagger.#Merge & {
mergediff: core.#Merge & {
inputs: [
busyboxBase.output,
removeme.output,
diff.output,
]
}
verify_remove: dagger.#Exec & {
verify_remove: core.#Exec & {
input: mergediff.output
args: ["test", "!", "-e", "/removeme"]
}
verify_no_alpine_base: dagger.#Exec & {
verify_no_alpine_base: core.#Exec & {
input: mergediff.output
// 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
args: ["test", "!", "-e", "/etc/alpine-release"]
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2,20 +2,21 @@ package main
import (
"dagger.io/dagger"
"dagger.io/dagger/core"
)
dagger.#Plan & {
actions: {
image: dagger.#Pull & {
image: core.#Pull & {
source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3"
}
exec: dagger.#Exec & {
exec: core.#Exec & {
input: image.output
args: ["sh", "-c", "echo -n hello world > /output.txt"]
}
verify: dagger.#ReadFile & {
verify: core.#ReadFile & {
input: exec.output
path: "/output.txt"
} & {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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