2887139bf7
- Improve #Container with a better docker.#Run integration - Supports concurrency caching in #Container - Simplify code maintainability and readability - Simplify binary export in #Build - Support multi binary building - External #Version management Signed-off-by: Vasek - Tom C <tom.chauveau@epitech.eu>
44 lines
763 B
CUE
44 lines
763 B
CUE
package go
|
|
|
|
import (
|
|
"dagger.io/dagger"
|
|
"universe.dagger.io/go"
|
|
"universe.dagger.io/docker"
|
|
"universe.dagger.io/alpine"
|
|
)
|
|
|
|
dagger.#Plan & {
|
|
inputs: directories: testhello: path: "./data/hello"
|
|
|
|
actions: tests: build: {
|
|
_baseImage: alpine.#Build
|
|
|
|
simple: {
|
|
build: go.#Build & {
|
|
source: inputs.directories.testhello.contents
|
|
}
|
|
|
|
exec: docker.#Run & {
|
|
input: _baseImage.output
|
|
command: {
|
|
name: "/bin/sh"
|
|
args: ["-c", "/bin/hello >> /output.txt"]
|
|
}
|
|
env: NAME: "dagger"
|
|
mounts: binary: {
|
|
dest: "/bin/hello"
|
|
contents: build.binary
|
|
source: "/test"
|
|
}
|
|
}
|
|
|
|
verify: dagger.#ReadFile & {
|
|
input: exec.output.rootfs
|
|
path: "/output.txt"
|
|
} & {
|
|
contents: "Hi dagger!"
|
|
}
|
|
}
|
|
}
|
|
}
|