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/pkg/universe.dagger.io/bash/test/test.cue
Solomon Hykes ce1a5659eb docker.#Run: remove redundant image field
Signed-off-by: Solomon Hykes <solomon@dagger.io>
2022-02-09 19:59:22 +00:00

50 lines
893 B
CUE

package bash
import (
"dagger.io/dagger"
"universe.dagger.io/docker"
"universe.dagger.io/bash"
)
dagger.#Plan & {
actions: tests: {
_pull: docker.#Pull & {
source: "index.docker.io/debian"
}
_image: _pull.output
// Run a script from source directory + filename
runFile: {
dir: _load.output
_load: dagger.#Source & {
path: "./data"
include: ["*.sh"]
}
run: bash.#Run & {
input: _image
export: files: "/out.txt": _
script: {
directory: dir
filename: "hello.sh"
}
}
output: run.export.files."/out.txt".contents & "Hello, world\n"
}
// Run a script from string
runString: {
run: bash.#Run & {
input: _image
export: files: "/output.txt": _
script: contents: "echo 'Hello, inlined world!' > /output.txt"
}
output: run.export.files."/output.txt".contents & "Hello, inlined world!\n"
}
}
}