Add test for docker example
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
2
tests/stdlib/docker/build/Dockerfile
Normal file
2
tests/stdlib/docker/build/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
||||
FROM alpine
|
||||
RUN echo test >> /test.txt
|
31
tests/stdlib/docker/build/build.cue
Normal file
31
tests/stdlib/docker/build/build.cue
Normal file
@@ -0,0 +1,31 @@
|
||||
package docker
|
||||
|
||||
import (
|
||||
"dagger.io/dagger"
|
||||
"dagger.io/dagger/op"
|
||||
"dagger.io/docker"
|
||||
)
|
||||
|
||||
// Build a Docker image from source, using included Dockerfile
|
||||
source: dagger.#Artifact
|
||||
|
||||
TestBuild: {
|
||||
image: docker.#Build & {
|
||||
"source": source
|
||||
}
|
||||
|
||||
verify: #up: [
|
||||
op.#Load & {
|
||||
from: image
|
||||
},
|
||||
|
||||
op.#Exec & {
|
||||
always: true
|
||||
args: [
|
||||
"sh", "-c", """
|
||||
grep -q "test" /test.txt
|
||||
""",
|
||||
]
|
||||
},
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user