Move push and pull tests plans to docker subpackages

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau
2021-06-26 17:06:30 +02:00
parent 5468f60e39
commit 67a982eb0f
6 changed files with 34 additions and 32 deletions

View File

@@ -1,63 +0,0 @@
package docker
import (
"dagger.io/dagger/op"
"dagger.io/dagger"
"dagger.io/docker"
"dagger.io/alpine"
"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 and pull"}
name: "daggerio/ci-test:\(tag.out)"
secret: #TestGetSecret & {
secret: TestRegistry.secret
}
image: docker.#ImageFromDockerfile & {
dockerfile: """
FROM alpine
RUN echo "test" > /test.txt
"""
context: ""
}
push: docker.#Push & {
"name": name
source: image
auth: {
username: TestRegistry.username
"secret": secret.out
}
}
}

View File

@@ -1,5 +1,6 @@
plan:
module: .dagger/env/docker-push/plan
module: ./docker
package: ./tests/push
name: docker-push
inputs:
TestRegistry.secret:
@@ -21,8 +22,8 @@ sops:
UjFJYTc1UUUzSFVkZjQ2blRsSGpVdVEKOanMR3+WlAgoDfqTUW7WPW1ytT3NdkTX
4Rqo49QmnuKFJ9tKoBFQOqgIo8E/lpcOkeIUiy5e/35FvsZ/KFk/pg==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2021-06-18T19:34:53Z"
mac: ENC[AES256_GCM,data:2LqpZGLCgN4d72hZMSs9uuIy0Eh69eP9JfhCcCvnIUg8kXcr5/mThST3Xum1LHJsAwfXIxPQPuz2ZzlcWksgYczNalU+ibTVk6N3nLi4ynrbV5QXaoS2MUmJHx6Y4VsjKHg13DQOysqcCa3+vY3WKxZ/WLgkI0rVOwZMELQBfXo=,iv:LeVFP37Y0rpLJa3IpbHD0N1ZARH139dz434c+uLv+Yo=,tag:yjlfzzcvvFzmVnvBX+8aAg==,type:str]
lastmodified: "2021-06-26T14:53:13Z"
mac: ENC[AES256_GCM,data:kxzdmyQwRIVP9D+w9LzRDIZOxDUqpSaGeD/GqaVxnQivEUjVFK5ePAcYV1fzjU4eeO3chIrP8NpvpIKZ1LztQddsPdTj72Yffgc5yq8/dGa3njiM8p9oa5hnZNoxLtyVPgRoNy3ZUZ6YSN9nqCFWW0DCjeSoiDlPX+1Vj/S6PeM=,iv:DhX4N6idS3VBaqau6k9yH+li34hOd3jqBsJJQu/P3Jw=,tag:X+taa7XgRmovR0JkhGpi7g==,type:str]
pgp: []
encrypted_suffix: secret
version: 3.7.1