This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/tests/plan/do/dynamic_tasks.cue

50 lines
980 B
CUE
Raw Normal View History

package main
import (
"dagger.io/dagger"
"universe.dagger.io/alpine"
"universe.dagger.io/bash"
)
dagger.#Plan & {
outputs: files: dagger: {
dest: "./dagger_do"
contents: actions.test.b.y.export.files["/output.txt"]
}
actions: {
image: alpine.#Build & {
packages: bash: {}
}
test: {
a: bash.#Run & {
input: image.output
script: contents: "echo -n 'from dagger with love' > /output.txt"
export: files: "/output.txt": string
}
b: {
x: bash.#Run & {
input: image.output
script: contents: "echo -n testing > /output.txt"
export: files: "/output.txt": string
}
// This fails. Building the Actions lookup table breaks
if x.export.files["/output.txt"] == "testing" {
y: bash.#Run & {
input: a.output
script: contents: "echo -n hello from y"
export: files: "/output.txt": string
}
}
}
}
notMe: bash.#Run & {
input: image.output
script: contents: "false"
}
}
}