c6da3eeb9e
Signed-off-by: Vasek - Tom C <tom.chauveau@epitech.eu>
70 lines
1.2 KiB
CUE
70 lines
1.2 KiB
CUE
package docker
|
|
|
|
import (
|
|
"dagger.io/dagger"
|
|
"universe.dagger.io/docker"
|
|
)
|
|
|
|
dagger.#Plan & {
|
|
client: filesystem: "./testdata": read: contents: dagger.#FS
|
|
|
|
actions: test: dockerfile: {
|
|
simple: {
|
|
build: docker.#Build & {
|
|
steps: [
|
|
docker.#Dockerfile & {
|
|
source: dagger.#Scratch
|
|
dockerfile: contents: """
|
|
FROM alpine:3.15
|
|
|
|
RUN echo -n hello world >> /test.txt
|
|
"""
|
|
},
|
|
docker.#Run & {
|
|
command: {
|
|
name: "/bin/sh"
|
|
args: ["-c", """
|
|
# Verify that docker.#Dockerfile correctly connect output
|
|
# into other steps
|
|
grep -q "hello world" /test.txt
|
|
"""]
|
|
}
|
|
},
|
|
]
|
|
}
|
|
|
|
verify: dagger.#ReadFile & {
|
|
input: build.output.rootfs
|
|
path: "/test.txt"
|
|
} & {
|
|
contents: "hello world"
|
|
}
|
|
}
|
|
|
|
withInput: {
|
|
build: docker.#Build & {
|
|
steps: [
|
|
docker.#Dockerfile & {
|
|
source: client.filesystem."./testdata".read.contents
|
|
},
|
|
docker.#Run & {
|
|
command: {
|
|
name: "/bin/sh"
|
|
args: ["-c", """
|
|
hello >> /test.txt
|
|
"""]
|
|
}
|
|
},
|
|
]
|
|
}
|
|
|
|
verify: dagger.#ReadFile & {
|
|
input: build.output.rootfs
|
|
path: "/test.txt"
|
|
} & {
|
|
contents: "hello world"
|
|
}
|
|
}
|
|
}
|
|
}
|