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/go/test/build.cue
Tom Chauveau 2887139bf7
Apply Solomon comments on universe.dagger.io/go
- 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>
2022-02-17 16:01:16 +01:00

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!"
}
}
}
}