Add test build with args to Docker #Build

Signed-off-by: Kevin Poirot <kevin@vazee.fr>
This commit is contained in:
Kevin Poirot 2021-09-14 10:00:00 +02:00
parent 3e14920062
commit a364307f0e

View File

@ -28,6 +28,34 @@ TestBuild: {
]
}
TestBuildWithArgs: {
image: #Build & {
dockerfile: """
FROM alpine
ARG TEST
ENV TEST=$TEST
RUN echo "$TEST" > /test.txt
"""
source: ""
args: TEST: "test"
}
verify: #up: [
op.#Load & {
from: image
},
op.#Exec & {
always: true
args: [
"sh", "-c", """
grep -q "test" /test.txt
""",
]
},
]
}
TestSourceImageFromDockerfile: dagger.#Artifact @dagger(input)
TestImageFromDockerfile: {