Rename field according to @shykes review

Signed-off-by: Tom Chauveau <tom.chauveau@epitech.eu>
This commit is contained in:
Tom Chauveau 2021-06-28 14:48:49 +02:00
parent 67a982eb0f
commit d10f2a49a5
4 changed files with 20 additions and 16 deletions

View File

@ -76,7 +76,7 @@ Push a docker image to a remote registry
| Name | Type | Description |
| ------------- |:-------------: |:-------------: |
|*name* | `string` |Remote name (example: "index.docker.io/alpine:latest") |
|*target* | `string` |Remote target (example: "index.docker.io/alpine:latest") |
|*source* | `dagger.#Artifact` |Image source |
|*auth.username* | `string` |Username |
|*auth.secret* | `string` |Password or secret |

View File

@ -30,8 +30,8 @@ import (
// Push a docker image to a remote registry
#Push: {
// Remote name (example: "index.docker.io/alpine:latest")
name: string @dagger(input)
// Remote target (example: "index.docker.io/alpine:latest")
target: string @dagger(input)
// Image source
source: dagger.#Artifact @dagger(input)
@ -50,13 +50,13 @@ import (
if auth != _|_ {
op.#DockerLogin & {
target: name
"target": target
username: auth.username
secret: auth.secret
}
},
op.#PushContainer & {ref: name},
op.#PushContainer & {ref: target},
op.#Subdir & {dir: "/dagger"},
]

View File

@ -10,9 +10,11 @@ TestRegistry: {
}
TestPush: {
// Generate a random string
// Seed is used to force buildkit execution and not simply use a previous generated string.
tag: random.#String & {seed: "docker push and pull should fail"}
name: "daggerio/ci-test:\(tag.out)"
target: "daggerio/ci-test:\(tag.out)"
image: #ImageFromDockerfile & {
dockerfile: """
@ -23,7 +25,7 @@ TestPush: {
}
push: #Push & {
"name": name
"target": target
source: image
auth: {
username: TestRegistry.username

View File

@ -35,9 +35,11 @@ TestRegistry: {
}
TestPush: {
// Generate a random string
// Seed is used to force buildkit execution and not simply use a previous generated string.
tag: random.#String & {seed: "docker push"}
name: "daggerio/ci-test:\(tag.out)"
target: "daggerio/ci-test:\(tag.out)"
secret: #TestGetSecret & {
secret: TestRegistry.secret
@ -52,7 +54,7 @@ TestPush: {
}
push: #Push & {
"name": name
"target": target
source: image
auth: {
username: TestRegistry.username