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/stdlib/docker/tests/push/push.cue
Tom Chauveau 67a982eb0f Move push and pull tests plans to docker subpackages
Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
2021-06-30 16:58:04 +02:00

63 lines
946 B
CUE

package docker
import (
"alpha.dagger.io/dagger/op"
"alpha.dagger.io/dagger"
"alpha.dagger.io/alpine"
"alpha.dagger.io/random"
)
TestRegistry: {
username: string @dagger(input)
secret: dagger.#Secret @dagger(input)
}
#TestGetSecret: {
secret: dagger.#Artifact
out: {
string
#up: [
op.#Load & {from: alpine.#Image},
op.#Exec & {
always: true
args: ["sh", "-c", "cp /input/secret /secret"]
mount: "/input/secret": "secret": secret
},
op.#Export & {
source: "/secret"
},
]
}
}
TestPush: {
tag: random.#String & {seed: "docker push"}
name: "daggerio/ci-test:\(tag.out)"
secret: #TestGetSecret & {
secret: TestRegistry.secret
}
image: #ImageFromDockerfile & {
dockerfile: """
FROM alpine
RUN echo "test" > /test.txt
"""
context: ""
}
push: #Push & {
"name": name
source: image
auth: {
username: TestRegistry.username
"secret": secret.out
}
}
}